Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Vipin Kumar

On 3/1/2013 12:58 PM, Albert ARIBAUD wrote:

Hi Vipin,

On Fri, 1 Mar 2013 09:11:33 +0530, Vipin Kumar
wrote:


On 2/28/2013 6:29 PM, Albert ARIBAUD wrote:

On Sun, 3 Feb 2013 12:19:26 +0100, Albert ARIBAUD
   wrote:


Hi Vipin,

On Fri, 2 Nov 2012 23:09:59 +0530, Vipin Kumar
wrote:


From: Shiraz Hashim

It is observed on SPEAr320S RMII#1 interface that on transmitting
packets the MAC dma hangs randomly and constantly showing busy tx-go
state.

It comes out if this situation only when Transmission is disabled and
enabled again.

Since it happens randomly and u-boot doesn't require high performance we
disable TE and re-enable it on each transmission. We also change number
of transmit descriptor to 1 as we would not require more than it, further
it would not alter GMAC notion of transmit descriptor start queue as it
always point to same descriptor.

Signed-off-by: Shiraz Hashim
---
   drivers/net/macb.c | 38 ++
   1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index ac25b52..17bad33 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -55,7 +55,7 @@

   #define CONFIG_SYS_MACB_RX_BUFFER_SIZE   4096
   #define CONFIG_SYS_MACB_RX_RING_SIZE (CONFIG_SYS_MACB_RX_BUFFER_SIZE 
/ 128)
-#define CONFIG_SYS_MACB_TX_RING_SIZE   16
+#define CONFIG_SYS_MACB_TX_RING_SIZE   1
   #define CONFIG_SYS_MACB_TX_TIMEOUT   1000
   #define CONFIG_SYS_MACB_AUTONEG_TIMEOUT  500

@@ -226,7 +226,13 @@ static int macb_send(struct eth_device *netdev, void 
*packet, int length)
macb->tx_ring[tx_head].ctrl = ctrl;
macb->tx_ring[tx_head].addr = paddr;
barrier();
-   macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
+   /*
+* Due to issues on SPEAr320 RMII, disable TE first so that
+* controller can come out if it is hanged during transmission
+*/
+   macb_writel(macb, NCR, macb_readl(macb, NCR)&   ~MACB_BIT(TE));
+   macb_writel(macb, NCR, macb_readl(macb, NCR) |
+   MACB_BIT(TE) | MACB_BIT(TSTART));

/*
 * I guess this is necessary because the networking core may
@@ -444,6 +450,31 @@ static int macb_phy_init(struct macb_device *macb)
}
   }

+static void macb_reset_hw(struct macb_device *bp)
+{
+   /* Make sure we have the write buffer for ourselves */
+   barrier();
+   /*
+* Disable RX and TX (XXX: Should we halt the transmission
+* more gracefully?) and we should not close the mdio port
+*/
+   macb_writel(bp, NCR, 0);
+
+   /* Clear the stats registers (XXX: Update stats first?) */
+   macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
+
+   /* keep the mdio port , otherwise other eth will not work */
+   macb_writel(bp, NCR, MACB_BIT(MPE));
+
+   /* Clear all status flags */
+   macb_writel(bp, TSR, ~0UL);
+   macb_writel(bp, RSR, ~0UL);
+
+   /* Disable all interrupts */
+   macb_writel(bp, IDR, ~0UL);
+   macb_readl(bp, ISR);
+}
+
   static int macb_init(struct eth_device *netdev, bd_t *bd)
   {
struct macb_device *macb = to_macb(netdev);
@@ -520,8 +551,7 @@ static void macb_halt(struct eth_device *netdev)
tsr = macb_readl(macb, TSR);
} while (tsr&   MACB_BIT(TGO));

-   /* Disable TX and RX, and clear statistics */
-   macb_writel(macb, NCR, MACB_BIT(CLRSTAT));
+   macb_reset_hw(macb);
   }

   static int macb_write_hwaddr(struct eth_device *dev)


This patch did not reappear in later versions of the series, and no
other standalone patch seems to match it. Was it dropped?


Ping?



No, I have been busy with something. I would come back to the u-boot
development soon


Thanks. Following your discussion with Bo Shen, should I expect a new
version of this patch in the future, or does it stand as it is?



A new version

Vipin


Vipin


Amicalement,


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


Re: [U-Boot] [PATCH 0/2] ARM: mmu: Set domain permissions to client access - build warnings!

2013-02-28 Thread Albert ARIBAUD
Hi Sricharan,

On Fri, 1 Mar 2013 09:57:25 +0530, Sricharan R 
wrote:

> Hi Albert,
> 
> On Thursday 28 February 2013 08:35 PM, Albert ARIBAUD wrote:
> > On Thu, 28 Feb 2013 15:20:44 +0100, Albert ARIBAUD
> >   wrote:
> >
> >> (sorry for any duplicate of this mail)
> >>
> >> Hi R Sricharan,
> >>
> >> On Tue, 8 Jan 2013 23:38:22 +0530, R Sricharan
> >> wrote:
> >>
> >>> Currently for ARM based cpu's, mmu pagetable attributes are set with
> >>> manager permissions for all 4GB address space. Because of this the
> >>> 'execute never (XN)' permission is never checked on read sensitive
> >>> regions which results in speculative aborts.
> >>>
> >>> This series changes the domain permissions of the full 4GB space
> >>> to client access for OMAP socs. This avoids all the speculative
> >>> aborts that are currently seen on OMAP5 secure devices.
> >>>
> >>> Tested on OMAP5 SDP (HS) soc.
> >>>
> >>> This series depends on [1] the patch sent by
> >>> 
> >>>
> >>> [1] http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html
> >>>
> >>> R Sricharan (2):
> >>>ARM: mmu: Introduce weak dram_bank_setup function
> >>>ARM: mmu: Set domain permissions to client access
> >>>
> >>>   arch/arm/cpu/armv7/cache_v7.c  |3 ++
> >>>   arch/arm/cpu/armv7/omap-common/hwinit-common.c |   35 
> >>> 
> >>>   arch/arm/include/asm/cache.h   |1 +
> >>>   arch/arm/include/asm/system.h  |   14 ++
> >>>   arch/arm/lib/cache-cp15.c  |   13 -
> >>>   5 files changed, 65 insertions(+), 1 deletion(-)
> >>>
> >> Series applied to u-boot-arm/master, thanks!
> > Correction: I'd wrongly inferred from the testing done on OMAP5 that
> > the series would build fine. However it appears that for targets
> > omap4_sdp4430, omap4_panda and omap5_evm, patch 2/2 has warnings:
> >
> > hwinit-common.c: In function 'dram_bank_mmu_setup':
> > hwinit-common.c:279:3: warning: implicit declaration of function
> > 'set_section_dcache' [-Wimplicit-function-declaration]
> >
> > Luckily, I had not committed to the git repo yet.
> >
> > R Sicharan, can you please check and fix this warning?
> >
> > Amicalement,
> Oh, thats because as i mentioned above, it depends on the below
> patch from vincent .
> 
>http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html
> 
> I did not repost it though.  I will do it now for clarity.

Ok -- Vincent's patch was not in my Patchwork TODO and I had read 
patches 1/2 and 2/2 in Patchwork, but I had not read the cover
letter thoroughly enough so I had missed the dependency.

(Cc:ing Vincent and Tom)

Vincent's patch series is delegated to Tom and marked "superseded" in
Patchwork but I don't see any later, superseding, series. What
can/should I make of it?

> Regards,
>   Sricharan

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


[U-Boot] [PATCH] usb: Add new command to set USB 2.0 port test modes

2013-02-28 Thread Julius Werner
This patch adds a new 'usb test' command, that will set a port to a USB
2.0 test mode (see USB 2.0 spec 7.1.20). It supports all five test modes
on both downstream hub ports and ordinary device's upstream ports. In
addition, it supports EHCI root hub ports.

Signed-off-by: Julius Werner 
---
 common/cmd_usb.c| 121 +++-
 drivers/usb/host/ehci-hcd.c |  25 +
 include/usb_defs.h  |  13 +
 3 files changed, 125 insertions(+), 34 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index dacdc2d..adc5f02 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -269,6 +269,22 @@ static void usb_display_config(struct usb_device *dev)
printf("\n");
 }
 
+static struct usb_device *usb_find_device(int devnum)
+{
+   struct usb_device *dev;
+   int d;
+
+   for (d = 0; d < USB_MAX_DEVICE; d++) {
+   dev = usb_get_dev_index(d);
+   if (dev == NULL)
+   return NULL;
+   if (dev->devnum == devnum)
+   return dev;
+   }
+
+   return NULL;
+}
+
 static inline char *portspeed(int speed)
 {
if (speed == USB_SPEED_HIGH)
@@ -348,6 +364,66 @@ static void usb_show_tree(struct usb_device *dev)
usb_show_tree_graph(dev, &preamble[0]);
 }
 
+static int usb_test(struct usb_device *dev, int port, char* arg)
+{
+   int mode;
+
+   if (port > dev->maxchild) {
+   printf("Device is no hub or does not have %d ports.\n", port);
+   return 1;
+   }
+
+   switch (arg[0]) {
+   case 'J':
+   case 'j':
+   printf("Setting Test_J mode");
+   mode = USB_TEST_MODE_J;
+   break;
+   case 'K':
+   case 'k':
+   printf("Setting Test_K mode");
+   mode = USB_TEST_MODE_K;
+   break;
+   case 'S':
+   case 's':
+   printf("Setting Test_SE0_NAK mode");
+   mode = USB_TEST_MODE_SE0_NAK;
+   break;
+   case 'P':
+   case 'p':
+   printf("Setting Test_Packet mode");
+   mode = USB_TEST_MODE_PACKET;
+   break;
+   case 'F':
+   case 'f':
+   printf("Setting Test_Force_Enable mode");
+   mode = USB_TEST_MODE_FORCE_ENABLE;
+   break;
+   default:
+   printf("Unrecognized test mode: %s\nAvailable modes: "
+  "J, K, S[E0_NAK], P[acket], F[orce_Enable]\n", arg);
+   return 1;
+   }
+
+   if (port)
+   printf(" on downstream facing port %d...\n", port);
+   else
+   printf(" on upstream facing port...\n");
+
+   if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_FEATURE,
+   port ? USB_RT_PORT : USB_RECIP_DEVICE,
+   port ? USB_PORT_FEAT_TEST : USB_FEAT_TEST,
+   (mode << 8) | port,
+   NULL, 0, USB_CNTL_TIMEOUT) == -1) {
+   printf("Error during SET_FEATURE.\n");
+   return 1;
+   } else {
+   printf("Test mode successfully set. Use 'usb start' "
+  "to return to normal operation.\n");
+   return 0;
+   }
+}
+
 
 /**
  * usb boot command intepreter. Derived from diskboot
@@ -441,17 +517,9 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
return 0;
} else {
-   int d;
-
-   i = simple_strtoul(argv[2], NULL, 16);
+   i = simple_strtoul(argv[2], NULL, 10);
printf("config for device %d\n", i);
-   for (d = 0; d < USB_MAX_DEVICE; d++) {
-   dev = usb_get_dev_index(d);
-   if (dev == NULL)
-   break;
-   if (dev->devnum == i)
-   break;
-   }
+   dev = usb_find_device(i);
if (dev == NULL) {
printf("*** No device available ***\n");
return 0;
@@ -462,6 +530,18 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
return 0;
}
+   if (strncmp(argv[1], "test", 4) == 0) {
+   if (argc < 5)
+   return CMD_RET_USAGE;
+   i = simple_strtoul(argv[2], NULL, 10);
+   dev = usb_find_device(i);
+   if (dev == NULL) {
+   printf("Device %d does not exist.\n", i);
+   return 1;
+   }
+   i = simple_strtoul(argv[3], 

Re: [U-Boot] [PATCH] usb: Add new command to set USB 2.0 port test modes

2013-02-28 Thread Julius Werner
Oops... I somehow pulled three lines of other local changes in there
that don't belong when I cherry-picked this into my upstream branch.
Sorry, will resubmit this once more.

On Tue, Feb 19, 2013 at 5:14 PM, Julius Werner  wrote:
> This patch adds a new 'usb test' command, that will set a port to a USB
> 2.0 test mode (see USB 2.0 spec 7.1.20). It supports all five test modes
> on both downstream hub ports and ordinary device's upstream ports. In
> addition, it supports EHCI root hub ports.
>
> Signed-off-by: Julius Werner 
> ---
>  common/cmd_usb.c| 121 
> +++-
>  drivers/usb/host/ehci-hcd.c |  30 +++
>  include/usb_defs.h  |  13 +
>  3 files changed, 130 insertions(+), 34 deletions(-)
>
> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
> index dacdc2d..adc5f02 100644
> --- a/common/cmd_usb.c
> +++ b/common/cmd_usb.c
> @@ -269,6 +269,22 @@ static void usb_display_config(struct usb_device *dev)
> printf("\n");
>  }
>
> +static struct usb_device *usb_find_device(int devnum)
> +{
> +   struct usb_device *dev;
> +   int d;
> +
> +   for (d = 0; d < USB_MAX_DEVICE; d++) {
> +   dev = usb_get_dev_index(d);
> +   if (dev == NULL)
> +   return NULL;
> +   if (dev->devnum == devnum)
> +   return dev;
> +   }
> +
> +   return NULL;
> +}
> +
>  static inline char *portspeed(int speed)
>  {
> if (speed == USB_SPEED_HIGH)
> @@ -348,6 +364,66 @@ static void usb_show_tree(struct usb_device *dev)
> usb_show_tree_graph(dev, &preamble[0]);
>  }
>
> +static int usb_test(struct usb_device *dev, int port, char* arg)
> +{
> +   int mode;
> +
> +   if (port > dev->maxchild) {
> +   printf("Device is no hub or does not have %d ports.\n", port);
> +   return 1;
> +   }
> +
> +   switch (arg[0]) {
> +   case 'J':
> +   case 'j':
> +   printf("Setting Test_J mode");
> +   mode = USB_TEST_MODE_J;
> +   break;
> +   case 'K':
> +   case 'k':
> +   printf("Setting Test_K mode");
> +   mode = USB_TEST_MODE_K;
> +   break;
> +   case 'S':
> +   case 's':
> +   printf("Setting Test_SE0_NAK mode");
> +   mode = USB_TEST_MODE_SE0_NAK;
> +   break;
> +   case 'P':
> +   case 'p':
> +   printf("Setting Test_Packet mode");
> +   mode = USB_TEST_MODE_PACKET;
> +   break;
> +   case 'F':
> +   case 'f':
> +   printf("Setting Test_Force_Enable mode");
> +   mode = USB_TEST_MODE_FORCE_ENABLE;
> +   break;
> +   default:
> +   printf("Unrecognized test mode: %s\nAvailable modes: "
> +  "J, K, S[E0_NAK], P[acket], F[orce_Enable]\n", arg);
> +   return 1;
> +   }
> +
> +   if (port)
> +   printf(" on downstream facing port %d...\n", port);
> +   else
> +   printf(" on upstream facing port...\n");
> +
> +   if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_FEATURE,
> +   port ? USB_RT_PORT : USB_RECIP_DEVICE,
> +   port ? USB_PORT_FEAT_TEST : USB_FEAT_TEST,
> +   (mode << 8) | port,
> +   NULL, 0, USB_CNTL_TIMEOUT) == -1) {
> +   printf("Error during SET_FEATURE.\n");
> +   return 1;
> +   } else {
> +   printf("Test mode successfully set. Use 'usb start' "
> +  "to return to normal operation.\n");
> +   return 0;
> +   }
> +}
> +
>
>  
> /**
>   * usb boot command intepreter. Derived from diskboot
> @@ -441,17 +517,9 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
> char * const argv[])
> }
> return 0;
> } else {
> -   int d;
> -
> -   i = simple_strtoul(argv[2], NULL, 16);
> +   i = simple_strtoul(argv[2], NULL, 10);
> printf("config for device %d\n", i);
> -   for (d = 0; d < USB_MAX_DEVICE; d++) {
> -   dev = usb_get_dev_index(d);
> -   if (dev == NULL)
> -   break;
> -   if (dev->devnum == i)
> -   break;
> -   }
> +   dev = usb_find_device(i);
> if (dev == NULL) {
> printf("*** No device available ***\n");
> return 0;
> @@ -462,6 +530,18 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
> char

Re: [U-Boot] Add new NAND flash

2013-02-28 Thread garyio
Hi Scott,

I know it's been a while but did you ever get this part to work?

Thanks,
Garyio



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/U-Boot-Add-new-NAND-flash-tp72701p148633.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Albert ARIBAUD
Hi Vipin,

On Fri, 1 Mar 2013 09:11:33 +0530, Vipin Kumar 
wrote:

> On 2/28/2013 6:29 PM, Albert ARIBAUD wrote:
> > On Sun, 3 Feb 2013 12:19:26 +0100, Albert ARIBAUD
> >   wrote:
> >
> >> Hi Vipin,
> >>
> >> On Fri, 2 Nov 2012 23:09:59 +0530, Vipin Kumar
> >> wrote:
> >>
> >>> From: Shiraz Hashim
> >>>
> >>> It is observed on SPEAr320S RMII#1 interface that on transmitting
> >>> packets the MAC dma hangs randomly and constantly showing busy tx-go
> >>> state.
> >>>
> >>> It comes out if this situation only when Transmission is disabled and
> >>> enabled again.
> >>>
> >>> Since it happens randomly and u-boot doesn't require high performance we
> >>> disable TE and re-enable it on each transmission. We also change number
> >>> of transmit descriptor to 1 as we would not require more than it, further
> >>> it would not alter GMAC notion of transmit descriptor start queue as it
> >>> always point to same descriptor.
> >>>
> >>> Signed-off-by: Shiraz Hashim
> >>> ---
> >>>   drivers/net/macb.c | 38 ++
> >>>   1 file changed, 34 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> >>> index ac25b52..17bad33 100644
> >>> --- a/drivers/net/macb.c
> >>> +++ b/drivers/net/macb.c
> >>> @@ -55,7 +55,7 @@
> >>>
> >>>   #define CONFIG_SYS_MACB_RX_BUFFER_SIZE  4096
> >>>   #define CONFIG_SYS_MACB_RX_RING_SIZE
> >>> (CONFIG_SYS_MACB_RX_BUFFER_SIZE / 128)
> >>> -#define CONFIG_SYS_MACB_TX_RING_SIZE 16
> >>> +#define CONFIG_SYS_MACB_TX_RING_SIZE 1
> >>>   #define CONFIG_SYS_MACB_TX_TIMEOUT  1000
> >>>   #define CONFIG_SYS_MACB_AUTONEG_TIMEOUT 500
> >>>
> >>> @@ -226,7 +226,13 @@ static int macb_send(struct eth_device *netdev, void 
> >>> *packet, int length)
> >>>   macb->tx_ring[tx_head].ctrl = ctrl;
> >>>   macb->tx_ring[tx_head].addr = paddr;
> >>>   barrier();
> >>> - macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
> >>> + /*
> >>> +  * Due to issues on SPEAr320 RMII, disable TE first so that
> >>> +  * controller can come out if it is hanged during transmission
> >>> +  */
> >>> + macb_writel(macb, NCR, macb_readl(macb, NCR)&  ~MACB_BIT(TE));
> >>> + macb_writel(macb, NCR, macb_readl(macb, NCR) |
> >>> + MACB_BIT(TE) | MACB_BIT(TSTART));
> >>>
> >>>   /*
> >>>* I guess this is necessary because the networking core may
> >>> @@ -444,6 +450,31 @@ static int macb_phy_init(struct macb_device *macb)
> >>>   }
> >>>   }
> >>>
> >>> +static void macb_reset_hw(struct macb_device *bp)
> >>> +{
> >>> + /* Make sure we have the write buffer for ourselves */
> >>> + barrier();
> >>> + /*
> >>> +  * Disable RX and TX (XXX: Should we halt the transmission
> >>> +  * more gracefully?) and we should not close the mdio port
> >>> +  */
> >>> + macb_writel(bp, NCR, 0);
> >>> +
> >>> + /* Clear the stats registers (XXX: Update stats first?) */
> >>> + macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
> >>> +
> >>> + /* keep the mdio port , otherwise other eth will not work */
> >>> + macb_writel(bp, NCR, MACB_BIT(MPE));
> >>> +
> >>> + /* Clear all status flags */
> >>> + macb_writel(bp, TSR, ~0UL);
> >>> + macb_writel(bp, RSR, ~0UL);
> >>> +
> >>> + /* Disable all interrupts */
> >>> + macb_writel(bp, IDR, ~0UL);
> >>> + macb_readl(bp, ISR);
> >>> +}
> >>> +
> >>>   static int macb_init(struct eth_device *netdev, bd_t *bd)
> >>>   {
> >>>   struct macb_device *macb = to_macb(netdev);
> >>> @@ -520,8 +551,7 @@ static void macb_halt(struct eth_device *netdev)
> >>>   tsr = macb_readl(macb, TSR);
> >>>   } while (tsr&  MACB_BIT(TGO));
> >>>
> >>> - /* Disable TX and RX, and clear statistics */
> >>> - macb_writel(macb, NCR, MACB_BIT(CLRSTAT));
> >>> + macb_reset_hw(macb);
> >>>   }
> >>>
> >>>   static int macb_write_hwaddr(struct eth_device *dev)
> >>
> >> This patch did not reappear in later versions of the series, and no
> >> other standalone patch seems to match it. Was it dropped?
> >
> > Ping?
> >
> 
> No, I have been busy with something. I would come back to the u-boot 
> development soon

Thanks. Following your discussion with Bo Shen, should I expect a new
version of this patch in the future, or does it stand as it is?

> Vipin

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


Re: [U-Boot] M29EW flash is detected as 0xFF

2013-02-28 Thread Stefan Roese
On 01.03.2013 08:12, Jagan Teki wrote:
>>> I made a fix for hw cfi issue when device is operating in 8-bit mode,
>>> If the above changes are looks fine we may have this fix will solve
>>> the M29EW flashes operates under 8-bit mode.
>>>
>>> Could send your comments/views.
>>
>> Not sure if I understood you correctly. So I have to ask some questions:
>>
> 
> Firstly, apologies from my side by sending too many status updates
> that makes you confusion.

No problem. I have been slow on reacting.

>> Did you use this patch?
> 
> Yes, I have applied the same patch,
> 
>>
>> http://patchwork.ozlabs.org/patch/140863/
>>
>> Did it apply without issues to mainline U-Boot? Or did you have to make
>> some changes so that it can be applied? And did it fix the issues you
>> have seen before?
> 
> I have manually applied those changes as the index values are differ.
> I haven't added any newly code other than the patch changes.

If you had to make some changes to this patch, then please send the
changes / updated patch version as a new version (v3) to the list. So
that it applies clean now. And please change the commit text accordingly.

> Yes it fixed the error by detecting correct manufacture and device ID.

Only that? IIRC, then without this patch, writing to the 8-bit flash
didn't work at all. But I don't have such a board, so I can't really
test myself.

>> And did you have some make some further changes as well?
> 
> And apart from these patch change, I have changed one more this for
> numonyx M29EW fix
> for incorrect write buffer size..any way that I could send once these
> changes are pushed/reviewed.

Please send this additional change/fix as a separate patch to the list
as well.

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


Re: [U-Boot] M29EW flash is detected as 0xFF

2013-02-28 Thread Jagan Teki
Hi Stefan,

On Fri, Mar 1, 2013 at 12:29 PM, Stefan Roese  wrote:
> Hi Jagan,
>
> On 22.02.2013 16:32, Jagan Teki wrote:
>>> I am able to detect the correct Manufacture ID and device ID with these 
>>> changes.
>>>
>>> Bank # 1: CFI conformant flash (8 x 8)  Size: 64 MB in 512 Sectors
>>>   AMD Standard command set, Manufacturer ID: 0x89, Device ID: 0x7E2301
>>>   Erase timeout: 4096 ms, write timeout: 2 ms
>>>   Buffer write timeout: 5 ms, buffer size: 1024 bytes
>>>
>>> But the 1024 bytes buffer size is another issues, as Numonyx CFI
>>> wrongly mentioned 1024 instead of 256.
>>> Any way that we can fix I guess for N29EW flashes..
>>>
>>> but how these changes impacts the other flashes i don't ..
>>>
>>> Please find the log message.
>>
>> I made a fix for hw cfi issue when device is operating in 8-bit mode,
>> If the above changes are looks fine we may have this fix will solve
>> the M29EW flashes operates under 8-bit mode.
>>
>> Could send your comments/views.
>
> Not sure if I understood you correctly. So I have to ask some questions:
>

Firstly, apologies from my side by sending too many status updates
that makes you confusion.

> Did you use this patch?

Yes, I have applied the same patch,

>
> http://patchwork.ozlabs.org/patch/140863/
>
> Did it apply without issues to mainline U-Boot? Or did you have to make
> some changes so that it can be applied? And did it fix the issues you
> have seen before?

I have manually applied those changes as the index values are differ.
I haven't added any newly code other than the patch changes.

Yes it fixed the error by detecting correct manufacture and device ID.

>
> And did you have some make some further changes as well?

And apart from these patch change, I have changed one more this for
numonyx M29EW fix
for incorrect write buffer size..any way that I could send once these
changes are pushed/reviewed.

Thanks,
Jagan.

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


Re: [U-Boot] M29EW flash is detected as 0xFF

2013-02-28 Thread Stefan Roese
Hi Jagan,

On 22.02.2013 16:32, Jagan Teki wrote:
>> I am able to detect the correct Manufacture ID and device ID with these 
>> changes.
>>
>> Bank # 1: CFI conformant flash (8 x 8)  Size: 64 MB in 512 Sectors
>>   AMD Standard command set, Manufacturer ID: 0x89, Device ID: 0x7E2301
>>   Erase timeout: 4096 ms, write timeout: 2 ms
>>   Buffer write timeout: 5 ms, buffer size: 1024 bytes
>>
>> But the 1024 bytes buffer size is another issues, as Numonyx CFI
>> wrongly mentioned 1024 instead of 256.
>> Any way that we can fix I guess for N29EW flashes..
>>
>> but how these changes impacts the other flashes i don't ..
>>
>> Please find the log message.
> 
> I made a fix for hw cfi issue when device is operating in 8-bit mode,
> If the above changes are looks fine we may have this fix will solve
> the M29EW flashes operates under 8-bit mode.
> 
> Could send your comments/views.

Not sure if I understood you correctly. So I have to ask some questions:

Did you use this patch?

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

Did it apply without issues to mainline U-Boot? Or did you have to make
some changes so that it can be applied? And did it fix the issues you
have seen before?

And did you have some make some further changes as well?

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


[U-Boot] [PATCH v1] blackfin: Fit u-boot image size into limited nor flash on blackfin.

2013-02-28 Thread Sonic Zhang
From: Sonic Zhang 

- Disable NAND driver on bf537-stamp.
- Make MMC_SPI optional.
- Disable LCD driver on bf527-ezkit.
- Enlarge BF609 nor flash reserved size from 256k to 512k bytes.

Signed-off-by: Sonic Zhang 
Signed-off-by: Sonic Zhang 
---
 include/configs/bf527-ezkit.h |   12 ++--
 include/configs/bf537-stamp.h |   10 ++
 include/configs/bf609-ezkit.h |2 ++
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h
index 7b51b53..db1b613 100644
--- a/include/configs/bf527-ezkit.h
+++ b/include/configs/bf527-ezkit.h
@@ -149,10 +149,15 @@
 #define CONFIG_MUSB_TIMEOUT 10
 #endif
 
+/* Don't waste time transferring a logo over the UART */
+#if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART)
+/*# define CONFIG_VIDEO*/
+#endif
 
 /*
  * Video Settings
  */
+#ifdef CONFIG_VIDEO
 #ifdef CONFIG_BF527_EZKIT_REV_2_1
 # define CONFIG_LQ035Q1_SPI_BUS0
 # define CONFIG_LQ035Q1_SPI_CS 7
@@ -166,7 +171,7 @@
 #else
 # define EASYLOGO_HEADER 
 #endif
-
+#endif /* CONFIG_VIDEO */
 
 /*
  * Misc Settings
@@ -175,11 +180,6 @@
 #define CONFIG_RTC_BFIN
 #define CONFIG_UART_CONSOLE1
 
-/* Don't waste time transferring a logo over the UART */
-#if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART)
-# define CONFIG_VIDEO
-#endif
-
 
 /*
  * Pull in common ADI header for remaining command/environment setup
diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h
index 05029d4..25cebf8 100644
--- a/include/configs/bf537-stamp.h
+++ b/include/configs/bf537-stamp.h
@@ -52,7 +52,7 @@
 #define CONFIG_EBIU_AMBCTL0_VAL0x7BB07BB0
 #define CONFIG_EBIU_AMBCTL1_VAL0xFFC27BB0
 
-#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
 #define CONFIG_SYS_MALLOC_LEN  (384 * 1024)
 
 
@@ -135,15 +135,17 @@
 /*
  * SPI_MMC Settings
  */
+#define CONFIG_MMC_SPI
+#ifdef CONFIG_MMC_SPI
 #define CONFIG_MMC
 #define CONFIG_GENERIC_MMC
-#define CONFIG_MMC_SPI
-
+#endif
 
 /*
  * NAND Settings
  */
 /* #define CONFIG_NAND_PLAT */
+#ifdef CONFIG_NAND_PLAT
 #define CONFIG_SYS_NAND_BASE   0x20212000
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 
@@ -158,7 +160,7 @@
 #define NAND_PLAT_WRITE_CMD(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_CLE(chip), 
cmd)
 #define NAND_PLAT_WRITE_ADR(chip, cmd) BFIN_NAND_WRITE(BFIN_NAND_ALE(chip), 
cmd)
 #define NAND_PLAT_GPIO_DEV_READY   GPIO_PF3
-
+#endif /* CONFIG_NAND_PLAT */
 
 /*
  * CF-CARD IDE-HDD Support
diff --git a/include/configs/bf609-ezkit.h b/include/configs/bf609-ezkit.h
index f0ac86b..e7b02a5 100644
--- a/include/configs/bf609-ezkit.h
+++ b/include/configs/bf609-ezkit.h
@@ -156,6 +156,8 @@
 #undef CONFIG_UART_CONSOLE_IS_JTAG
 #endif
 
+#define CONFIG_BOARD_SIZE_LIMIT $$((512 * 1024))
+
 /*
  * Run core 1 from L1 SRAM start address when init uboot on core 0
  */
-- 
1.7.0.4


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


[U-Boot] [PATCH v1] kerneldoc: Add Sonic Zhang to alias bfin in git-mailrc.

2013-02-28 Thread Sonic Zhang
Signed-off-by: Sonic Zhang 
---
 doc/git-mailrc |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/doc/git-mailrc b/doc/git-mailrc
index 6600c15..0f23776 100644
--- a/doc/git-mailrc
+++ b/doc/git-mailrc
@@ -32,6 +32,7 @@ alias sbabic Stefano Babic 
 alias scottwood  Scott Wood 
 alias sjgSimon Glass 
 alias smcnuttScott McNutt 
+alias sonic  Sonic Zhang 
 alias stroeseStefan Roese 
 alias vapier Mike Frysinger 
 alias wd Wolfgang Denk 
@@ -57,7 +58,7 @@ alias ti uboot, Tom Rini 
 
 alias avr32  uboot, abiessmann
 
-alias bfin   uboot, vapier
+alias bfin   uboot, vapier, sonic
 alias blackfin   bfin
 
 alias m68k   uboot, jasonjin
-- 
1.7.0.4


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


Re: [U-Boot] [PATCH 1/4] EXYNOS5: FDT: Add compatible strings for Serial

2013-02-28 Thread Rajeshwari Birje
Hi Simon,

Thank you for comments.

On Thu, Feb 28, 2013 at 6:49 AM, Simon Glass  wrote:
> Hi
>
> On Tue, Feb 26, 2013 at 10:01 PM, Rajeshwari Shinde
>  wrote:
>> Add required compatible information for s5p serial driver
>>
>> Signed-off-by: Abhilash Kesavan 
>> Signed-off-by: Rajeshwari Shinde 
>> ---
>>  include/fdtdec.h |1 +
>>  lib/fdtdec.c |1 +
>>  2 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/fdtdec.h b/include/fdtdec.h
>> index 77f244f..cca9be1 100644
>> --- a/include/fdtdec.h
>> +++ b/include/fdtdec.h
>> @@ -81,6 +81,7 @@ enum fdt_compat_id {
>> COMPAT_SAMSUNG_EXYNOS_EHCI, /* Exynos EHCI controller */
>> COMPAT_SAMSUNG_EXYNOS_USB_PHY,  /* Exynos phy controller for usb2.0 
>> */
>> COMPAT_MAXIM_MAX77686_PMIC, /* MAX77686 PMIC */
>> +   COMPAT_SAMSUNG_EXYNOS5_SERIAL,  /* Exynos5 UART */
>>
>> COMPAT_COUNT,
>>  };
>> diff --git a/lib/fdtdec.c b/lib/fdtdec.c
>> index 3ae348d..ec19c4b 100644
>> --- a/lib/fdtdec.c
>> +++ b/lib/fdtdec.c
>> @@ -56,6 +56,7 @@ static const char * const compat_names[COMPAT_COUNT] = {
>> COMPAT(SAMSUNG_EXYNOS_EHCI, "samsung,exynos-ehci"),
>> COMPAT(SAMSUNG_EXYNOS_USB_PHY, "samsung,exynos-usb-phy"),
>> COMPAT(MAXIM_MAX77686_PMIC, "maxim,max77686_pmic"),
>> +   COMPAT(SAMSUNG_EXYNOS5_SERIAL, "samsung,exynos-uart"),
>
> The kernel seems to have this:
>
> serial@12C0 {
> compatible = "samsung,exynos4210-uart";
> reg = <0x12C0 0x100>;
> interrupts = <0 51 0>;
> };
>
> Should we use the same compatible string in U-Boot, or are you
> planning the change the kernel?
Okay in that case will keep the compatible string as "samsung,exynos4210-uart".
>
> Regards,
> Simon
>
>>  };
>>
>>  const char *fdtdec_get_compatible(enum fdt_compat_id id)
>> --
>> 1.7.4.4
>>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
-- 
Regards,
Rajeshwari Shinde
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 4/9] x86: Add an __end symbol to signal the end of the U-Boot binary

2013-02-28 Thread Simon Glass
With this symbol we can easy append something (e.g. an FDT) to the U-Boot
binary and access it from within U-Boot.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Use _end instead of __end to fit in with other archs

 arch/x86/cpu/u-boot.lds   | 2 ++
 arch/x86/include/asm/u-boot-x86.h | 1 +
 arch/x86/lib/init_helpers.c   | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index 2313cd7..8e185f3 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -67,6 +67,8 @@ SECTIONS
__rel_dyn_start = .;
.rel.dyn : { *(.rel.dyn) }
__rel_dyn_end = .;
+   . = ALIGN(4);
+   _end = .;
 
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
diff --git a/arch/x86/include/asm/u-boot-x86.h 
b/arch/x86/include/asm/u-boot-x86.h
index 99062e5..948615d 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -31,6 +31,7 @@ extern ulong __rel_dyn_start;
 extern ulong __rel_dyn_end;
 extern ulong __bss_start;
 extern ulong __bss_end;
+extern ulong _end;
 
 /* cpu/.../cpu.c */
 int x86_cpu_init_r(void);
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 1a097f1..ff2d21f 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -188,7 +188,7 @@ int find_fdt(void)
gd->fdt_blob = _binary_dt_dtb_start;
 #elif defined CONFIG_OF_SEPARATE
/* FDT is at end of image */
-   gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+   gd->fdt_blob = (ulong *)&_end;
 #endif
/* Allow the early environment to override the fdt address */
gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 6/9] x86: Support relocation of FDT on start-up

2013-02-28 Thread Simon Glass
With CONFIG_OF_CONTROL we may have an FDT in the BSS region. Relocate
it up with the rest of U-Boot to keep the rest of memory free.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Use arch-specific data for new fdt pointer

 arch/x86/include/asm/global_data.h  |  1 +
 arch/x86/include/asm/init_helpers.h |  2 ++
 arch/x86/include/asm/relocate.h |  1 +
 arch/x86/lib/board.c|  3 +++
 arch/x86/lib/init_helpers.c | 23 +--
 arch/x86/lib/init_wrappers.c|  1 +
 arch/x86/lib/relocate.c | 17 +
 7 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index 2f84abd..4fdb080 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -32,6 +32,7 @@ struct arch_global_data {
uint64_t tsc_base;  /* Initial value returned by rdtsc() */
uint32_t tsc_base_kclocks;  /* Initial tsc as a kclocks value */
uint32_t tsc_prev;  /* For show_boot_progress() */
+   void *new_fdt;  /* Relocated FDT */
 };
 
 #endif
diff --git a/arch/x86/include/asm/init_helpers.h 
b/arch/x86/include/asm/init_helpers.h
index 2f437e0..d018b29 100644
--- a/arch/x86/include/asm/init_helpers.h
+++ b/arch/x86/include/asm/init_helpers.h
@@ -38,5 +38,7 @@ int flash_init_r(void);
 int status_led_set_r(void);
 int set_load_addr_r(void);
 int init_func_spi(void);
+int find_fdt(void);
+int prepare_fdt(void);
 
 #endif /* !_INIT_HELPERS_H_ */
diff --git a/arch/x86/include/asm/relocate.h b/arch/x86/include/asm/relocate.h
index 33129ef..d371c9d 100644
--- a/arch/x86/include/asm/relocate.h
+++ b/arch/x86/include/asm/relocate.h
@@ -27,6 +27,7 @@
 #include 
 
 int copy_uboot_to_ram(void);
+int copy_fdt_to_ram(void);
 int clear_bss(void);
 int do_elf_reloc_fixups(void);
 
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 22bc26d..2441a66 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -32,6 +32,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -131,6 +132,7 @@ init_fnc_t *init_sequence_f[] = {
 init_fnc_t *init_sequence_f_r[] = {
init_cache_f_r,
copy_uboot_to_ram,
+   copy_fdt_to_ram,
clear_bss,
do_elf_reloc_fixups,
 
@@ -217,6 +219,7 @@ static void do_init_loop(init_fnc_t **init_fnc_ptr)
 
 void board_init_f(ulong boot_flags)
 {
+   gd->fdt_blob = gd->arch.new_fdt = NULL;
gd->flags = boot_flags;
 
do_init_loop(init_sequence_f);
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index ff2d21f..414fdcc 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -22,6 +22,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -85,17 +86,35 @@ int calculate_relocation_address(void)
(uintptr_t)&__text_start;
ulong total_size;
ulong dest_addr;
+   ulong fdt_size = 0;
 
+#if defined(CONFIG_OF_SEPARATE) && defined(CONFIG_OF_CONTROL)
+   if (gd->fdt_blob)
+   fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32);
+#endif
total_size = ALIGN(uboot_size, 1 << 12) + CONFIG_SYS_MALLOC_LEN +
-   CONFIG_SYS_STACK_SIZE;
+   CONFIG_SYS_STACK_SIZE + fdt_size;
 
+   dest_addr = board_get_usable_ram_top(total_size);
/*
 * NOTE: All destination address are rounded down to 16-byte
 *   boundary to satisfy various worst-case alignment
 *   requirements
 */
-   dest_addr = board_get_usable_ram_top(total_size);
+   dest_addr &= ~15;
 
+#if defined(CONFIG_OF_SEPARATE) && defined(CONFIG_OF_CONTROL)
+   /*
+* If the device tree is sitting immediate above our image then we
+* must relocate it. If it is embedded in the data section, then it
+* will be relocated with other data.
+*/
+   if (gd->fdt_blob) {
+   dest_addr -= fdt_size;
+   gd->arch.new_fdt = (void *)dest_addr;
+   dest_addr &= ~15;
+   }
+#endif
/* U-Boot is below the FDT */
dest_addr -= uboot_size;
dest_addr &= ~((1 << 12) - 1);
diff --git a/arch/x86/lib/init_wrappers.c b/arch/x86/lib/init_wrappers.c
index cca018f..19af875 100644
--- a/arch/x86/lib/init_wrappers.c
+++ b/arch/x86/lib/init_wrappers.c
@@ -22,6 +22,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 23edca9..3a38e52 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -32,6 +32,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +47,22 @@ int copy_uboot_to_ram(void)
return 0;
 }
 
+int copy_fdt_to_ram(void)
+{
+   if (gd->arch.new_fdt) {
+   ulong fdt_size;
+
+   fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32

[U-Boot] [PATCH v2 3/9] x86: Permit bootstage and timer data to be used prior to relocation

2013-02-28 Thread Simon Glass
It is useful to be able to access the timer before U-Boot has relocated
so that we can fully support bootstage.

Add new global_data members to support this.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Put timer variables in arch_global_data instead of data section

 arch/x86/cpu/coreboot/coreboot.c   | 15 ++-
 arch/x86/cpu/interrupts.c  |  7 +++
 arch/x86/include/asm/global_data.h |  3 +++
 arch/x86/lib/timer.c   |  9 -
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c
index 9c9431e..f8e28f0 100644
--- a/arch/x86/cpu/coreboot/coreboot.c
+++ b/arch/x86/cpu/coreboot/coreboot.c
@@ -68,24 +68,21 @@ int board_early_init_r(void)
 void show_boot_progress(int val)
 {
 #if MIN_PORT80_KCLOCKS_DELAY
-   static uint32_t prev_stamp;
-   static uint32_t base;
-
/*
 * Scale the time counter reading to avoid using 64 bit arithmetics.
 * Can't use get_timer() here becuase it could be not yet
 * initialized or even implemented.
 */
-   if (!prev_stamp) {
-   base = rdtsc() / 1000;
-   prev_stamp = 0;
+   if (!gd->arch.tsc_prev) {
+   gd->arch.tsc_base_kclocks = rdtsc() / 1000;
+   gd->arch.tsc_prev = 0;
} else {
uint32_t now;
 
do {
-   now = rdtsc() / 1000 - base;
-   } while (now < (prev_stamp + MIN_PORT80_KCLOCKS_DELAY));
-   prev_stamp = now;
+   now = rdtsc() / 1000 - gd->arch.tsc_base_kclocks;
+   } while (now < (gd->arch.tsc_prev + MIN_PORT80_KCLOCKS_DELAY));
+   gd->arch.tsc_prev = now;
}
 #endif
outb(val, 0x80);
diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index dd30a05..6dc74e3 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -626,13 +626,12 @@ asm(".globl irq_common_entry\n" \
  */
 u64 get_ticks(void)
 {
-   static u64 tick_base;
u64 now_tick = rdtsc();
 
-   if (!tick_base)
-   tick_base = now_tick;
+   if (!gd->arch.tsc_base)
+   gd->arch.tsc_base = now_tick;
 
-   return now_tick - tick_base;
+   return now_tick - gd->arch.tsc_base;
 }
 
 #define PLATFORM_INFO_MSR 0xce
diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index 8a96fc9..2f84abd 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -29,6 +29,9 @@
 /* Architecture-specific global data */
 struct arch_global_data {
struct global_data *gd_addr;/* Location of Global Data */
+   uint64_t tsc_base;  /* Initial value returned by rdtsc() */
+   uint32_t tsc_base_kclocks;  /* Initial tsc as a kclocks value */
+   uint32_t tsc_prev;  /* For show_boot_progress() */
 };
 
 #endif
diff --git a/arch/x86/lib/timer.c b/arch/x86/lib/timer.c
index a13424b..1f8ce60 100644
--- a/arch/x86/lib/timer.c
+++ b/arch/x86/lib/timer.c
@@ -37,7 +37,6 @@ struct timer_isr_function {
 
 static struct timer_isr_function *first_timer_isr;
 static unsigned long system_ticks;
-static uint64_t base_value;
 
 /*
  * register_timer_isr() allows multiple architecture and board specific
@@ -102,7 +101,7 @@ ulong get_timer(ulong base)
 
 void timer_set_tsc_base(uint64_t new_base)
 {
-   base_value = new_base;
+   gd->arch.tsc_base = new_base;
 }
 
 uint64_t timer_get_tsc(void)
@@ -110,8 +109,8 @@ uint64_t timer_get_tsc(void)
uint64_t time_now;
 
time_now = rdtsc();
-   if (!base_value)
-   base_value = time_now;
+   if (!gd->arch.tsc_base)
+   gd->arch.tsc_base = time_now;
 
-   return time_now - base_value;
+   return time_now - gd->arch.tsc_base;
 }
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 7/9] x86: Add error checking to x86 relocation code

2013-02-28 Thread Simon Glass
This does not actually change normal behaviour, but adds a check that
should detect corruption of relocation data (e.g. by using BSS data
prior to relocation).

Also add additional debugging output when enabled.

During this investigation, two situations have been seen:
1. calculate_relocation_address():
uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;

turns into
 66f:   b8 83 c4 17 01  mov$0x117c483,%eax

whih is beyond the end of bss:

0117b484 g   .bss    __bss_end

Somehow the __bss_end here is 255 bytes ahead.

2. do_elf_reloc_fixups():

uintptr_t size = (uintptr_t)&__bss_end - (uintptr_t)&__text_start;

Here the __text_start is 0 in the file:

 d9f:   bb a0 e0 13 01  mov$0x113e0a0,%ebx
da4:81 ef 00 00 00 00   sub$0x0,%edi

As it happens, both of these are in pre-relocation code.

For these reasons we silent check and ignore bad relocations.

Signed-off-by: Simon Glass 
---
Changes in v2: None

 arch/x86/lib/relocate.c | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 3a38e52..3e370f2 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -73,12 +73,16 @@ int clear_bss(void)
return 0;
 }
 
+/*
+ * This function has more error checking than you might expect. Please see
+ * the commit message for more informaiton.
+ */
 int do_elf_reloc_fixups(void)
 {
Elf32_Rel *re_src = (Elf32_Rel *)(&__rel_dyn_start);
Elf32_Rel *re_end = (Elf32_Rel *)(&__rel_dyn_end);
 
-   Elf32_Addr *offset_ptr_rom;
+   Elf32_Addr *offset_ptr_rom, *last_offset = NULL;
Elf32_Addr *offset_ptr_ram;
 
/* The size of the region of u-boot that runs out of RAM. */
@@ -89,7 +93,8 @@ int do_elf_reloc_fixups(void)
offset_ptr_rom = (Elf32_Addr *)re_src->r_offset;
 
/* Check that the location of the relocation is in .text */
-   if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE) {
+   if (offset_ptr_rom >= (Elf32_Addr *)CONFIG_SYS_TEXT_BASE &&
+   offset_ptr_rom > last_offset) {
 
/* Switch to the in-RAM version */
offset_ptr_ram = (Elf32_Addr *)((ulong)offset_ptr_rom +
@@ -100,8 +105,19 @@ int do_elf_reloc_fixups(void)
*offset_ptr_ram <=
(CONFIG_SYS_TEXT_BASE + size)) {
*offset_ptr_ram += gd->reloc_off;
+   } else {
+   debug("   %p: rom reloc %x, ram %p, value %x,"
+   " limit %lx\n", re_src,
+   re_src->r_offset, offset_ptr_ram,
+   *offset_ptr_ram,
+   CONFIG_SYS_TEXT_BASE + size);
}
+   } else {
+   debug("   %p: rom reloc %x, last %p\n", re_src,
+  re_src->r_offset, last_offset);
}
+   last_offset = offset_ptr_rom;
+
} while (++re_src < re_end);
 
return 0;
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 9/9] x86: Enable CONFIG_OF_CONTROL on coreboot

2013-02-28 Thread Simon Glass
Make use of a device tree on coreboot boards, and set the default
to link.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Drop patch which removes real mode code since it was already dealt with

 include/configs/coreboot.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
index c7f36ff..49f05de 100644
--- a/include/configs/coreboot.h
+++ b/include/configs/coreboot.h
@@ -42,6 +42,12 @@
 #define CONFIG_ZBOOT_32
 #define CONFIG_PHYSMEM
 
+#define CONFIG_LMB
+#define CONFIG_OF_LIBFDT
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+#define CONFIG_DEFAULT_DEVICE_TREE link
+
 /*---
  * Watchdog Configuration
  */
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 5/9] x86: Rearrange the output input to remove BSS

2013-02-28 Thread Simon Glass
At present BSS data is including in the image, which wastes binary space.
Remove it by rearranging the sections so that BSS is last.

Signed-off-by: Simon Glass 
---
Changes in v2: None

 arch/x86/cpu/u-boot.lds | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index 8e185f3..54f2fb7 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -46,9 +46,6 @@ SECTIONS
.data : { *(.data*) }
 
. = ALIGN(4);
-   .dynsym : { *(.dynsym*) }
-
-   . = ALIGN(4);
.hash : { *(.hash*) }
 
. = ALIGN(4);
@@ -58,10 +55,7 @@ SECTIONS
__data_end = .;
 
. = ALIGN(4);
-   __bss_start = ABSOLUTE(.);
-   .bss (NOLOAD) : { *(.bss) }
-   . = ALIGN(4);
-   __bss_end = ABSOLUTE(.);
+   .dynsym : { *(.dynsym*) }
 
. = ALIGN(4);
__rel_dyn_start = .;
@@ -70,6 +64,17 @@ SECTIONS
. = ALIGN(4);
_end = .;
 
+   . = ALIGN(4);
+
+   __end = .;
+   .bss __rel_dyn_start (OVERLAY) : {
+   __bss_start = .;
+   *(.bss)
+   *(COM*)
+   . = ALIGN(4);
+   __bss_end = .;
+   }
+
/DISCARD/ : { *(.dynstr*) }
/DISCARD/ : { *(.dynamic*) }
/DISCARD/ : { *(.plt*) }
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 8/9] x86: Adjust link device tree include file

2013-02-28 Thread Simon Glass
This is currently set to coreboot.dtsi, but we cannot support this on
old device tree compilers (dtc <= 1.3), so adjust to use ARCH_CPU_DTS
to let the Makefile preprocessor sort this out.

Signed-off-by: Simon Glass 
---
Changes in v2: None

 board/chromebook-x86/dts/link.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/chromebook-x86/dts/link.dts 
b/board/chromebook-x86/dts/link.dts
index af60f59..ae8217d 100644
--- a/board/chromebook-x86/dts/link.dts
+++ b/board/chromebook-x86/dts/link.dts
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "coreboot.dtsi"
+/include/ ARCH_CPU_DTS
 
 / {
 #address-cells = <1>;
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 1/9] x86: Add function to get top of usable ram

2013-02-28 Thread Simon Glass
The memory layout calculations are done in calculate_relocation_address(),
and coreboot has its own version of this function. But in fact all we
really need is to set the top of usable RAM, and then the base version
will work as is.

So instead of allowing the whole calculate_relocation_address() function
to be replaced, create board_get_usable_ram_top() which can be used by
a board to specify the top of the area where U-Boot relocations to.

Signed-off-by: Simon Glass 
---
Changes in v2: None

 arch/x86/cpu/coreboot/sdram.c | 18 --
 arch/x86/lib/init_helpers.c   | 28 ++--
 2 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index 76274cb..a8136a0 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -60,12 +60,8 @@ unsigned install_e820_map(unsigned max_entries, struct 
e820entry *entries)
  * address, and how far U-Boot is moved by relocation are set in the global
  * data structure.
  */
-int calculate_relocation_address(void)
+ulong board_get_usable_ram_top(ulong total_size)
 {
-   const uint64_t uboot_size = (uintptr_t)&__bss_end -
-   (uintptr_t)&__text_start;
-   const uint64_t total_size = uboot_size + CONFIG_SYS_MALLOC_LEN +
-   CONFIG_SYS_STACK_SIZE;
uintptr_t dest_addr = 0;
int i;
 
@@ -87,21 +83,15 @@ int calculate_relocation_address(void)
continue;
 
/* Use this address if it's the largest so far. */
-   if (end - uboot_size > dest_addr)
+   if (end > dest_addr)
dest_addr = end;
}
 
/* If no suitable area was found, return an error. */
if (!dest_addr)
-   return 1;
+   panic("No available memory found for relocation");
 
-   dest_addr -= uboot_size;
-   dest_addr &= ~((1 << 12) - 1);
-   gd->relocaddr = dest_addr;
-   gd->reloc_off = dest_addr - (uintptr_t)&__text_start;
-   gd->start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN;
-
-   return 0;
+   return (ulong)dest_addr;
 }
 
 int dram_init_f(void)
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 3eec9a6..1a097f1 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -73,26 +73,34 @@ int init_baudrate_f(void)
return 0;
 }
 
-__weak int calculate_relocation_address(void)
+/* Get the top of usable RAM */
+__weak ulong board_get_usable_ram_top(ulong total_size)
 {
-   ulong text_start = (ulong)&__text_start;
-   ulong bss_end = (ulong)&__bss_end;
+   return gd->ram_size;
+}
+
+int calculate_relocation_address(void)
+{
+   const ulong uboot_size = (uintptr_t)&__bss_end -
+   (uintptr_t)&__text_start;
+   ulong total_size;
ulong dest_addr;
 
+   total_size = ALIGN(uboot_size, 1 << 12) + CONFIG_SYS_MALLOC_LEN +
+   CONFIG_SYS_STACK_SIZE;
+
/*
 * NOTE: All destination address are rounded down to 16-byte
 *   boundary to satisfy various worst-case alignment
 *   requirements
 */
+   dest_addr = board_get_usable_ram_top(total_size);
 
-   /* Stack is at top of available memory */
-   dest_addr = gd->ram_size;
-
-   /* U-Boot is at the top */
-   dest_addr -= (bss_end - text_start);
-   dest_addr &= ~15;
+   /* U-Boot is below the FDT */
+   dest_addr -= uboot_size;
+   dest_addr &= ~((1 << 12) - 1);
gd->relocaddr = dest_addr;
-   gd->reloc_off = (dest_addr - text_start);
+   gd->reloc_off = dest_addr - (uintptr_t)&__text_start;
 
/* Stack is at the bottom, so it can grow down */
gd->start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN;
-- 
1.8.1.3

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


[U-Boot] [PATCH v2 2/9] x86: Add basic cache operations

2013-02-28 Thread Simon Glass
At present most x86 cache operations are undefined. Add a basic
implementation for these.

Signed-off-by: Simon Glass 
---
Changes in v2: None

 arch/x86/cpu/cpu.c | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 6a23974..1a2f85c 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -228,3 +228,26 @@ void flush_dcache_range(unsigned long start, unsigned long 
stop)
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
 }
+
+void dcache_enable(void)
+{
+   enable_caches();
+}
+
+void dcache_disable(void)
+{
+   disable_caches();
+}
+
+void icache_enable(void)
+{
+}
+
+void icache_disable(void)
+{
+}
+
+int icache_status(void)
+{
+   return 1;
+}
-- 
1.8.1.3

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


[U-Boot] [PATCH RESEND] ARM: cache: declare set_section_dcache

2013-02-28 Thread Sricharan R
From: Vincent Stehlé 

We declare the set_section_dcache function globally in the cache header, for
later use by e.g. machine specific code.

Signed-off-by: Vincent Stehlé  ti.com>
Cc: Tom Rini  ti.com>
Cc: Albert ARIBAUD 
---
 arch/arm/include/asm/cache.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index eef6a5a..416d2c8 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -41,6 +41,7 @@ static inline void invalidate_l2_cache(void)
 
 void l2_cache_enable(void);
 void l2_cache_disable(void);
+void set_section_dcache(int section, enum dcache_option option);
 
 /*
  * The current upper bound for ARM L1 data cache line sizes is 64 bytes.  We
-- 
1.7.9.5

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


Re: [U-Boot] FDT howto

2013-02-28 Thread Simon Glass
Hi Jagan,

On Thu, Feb 28, 2013 at 12:29 PM, Jagan Teki  wrote:
> Hi Simon,
>
> On Thu, Feb 28, 2013 at 7:22 PM, Simon Glass  wrote:
>> Hi Jagan,
>>
>> On Thu, Feb 28, 2013 at 3:14 AM, Jagan Teki  wrote:
>>> Hi Simon,
>>>
>>> On Mon, Feb 25, 2013 at 4:40 AM, Simon Glass  wrote:
 Hi Jagan,

 On Sun, Feb 24, 2013 at 10:58 AM, Jagan Teki  
 wrote:
> Hi Simon,
>
> On Sun, Feb 24, 2013 at 11:55 PM, Jagan Teki  
> wrote:
>> Hi Simon,
>>
>> On Sun, Feb 24, 2013 at 11:50 PM, Simon Glass  wrote:
>>> Hi,
>>>
>>> On Sun, Feb 24, 2013 at 9:55 AM, Jagan Teki  
>>> wrote:
 Hi Simon,

 On Sun, Feb 24, 2013 at 11:18 PM, Simon Glass  
 wrote:
> Hi Jegan,
>
> On Sun, Feb 24, 2013 at 9:45 AM, Jagan Teki 
>  wrote:
>> Hi Simon,
>>
>> On Sun, Feb 24, 2013 at 11:08 PM, Simon Glass  
>> wrote:
>>> Hi Jagan,
>>>
>>> On Sun, Feb 24, 2013 at 8:19 AM, Jagan Teki 
>>>  wrote:
 Hi Simon,

 Thanks for your response, please find my below comments.

 On Sun, Feb 24, 2013 at 9:24 PM, Simon Glass  
 wrote:
> Hi Jagan,
>
> On Thu, Feb 21, 2013 at 9:03 AM, Jagan Teki 
>  wrote:
>> Hi All,
>>
>> I am planning to use devicetree on u-boot.
>> I have an experience to work with devicetree on Linux.
>>
>> For u-boot, I have read doc from doc/README.fdt-control.
>> I see some dts usages on tegra boards.
>>
>> I have lot of confusions with the concept itself.
>>
>> Is Linux and u-boot devicetree concept and build system are same?
>
> I don't really understand this question sorry. U-Boot and Linux 
> use
> the device tree mainly for run-time configuration of drivers, so 
> that
> the same driver code can operate on different boards.

 I am some how confusing the fdt usage in u-boot.
 Because when compared to Linux, u-boot fdt setup mandatory to 
 require
 the CONFIG_DEFAULT_DEVICE_TREE
 on the config file [from your previous comments].

 is this the only difference when compared to Linux i guess..is it?
 Linux defconfig file does need to hot-code
 the dts.
>>>
>>> Yes - that is a difference. Linux provides a way to build .dts files
>>> but it is not mandatory. At present it is mandatory with U-Boot, and
>>> only one file is built. It can easily be ignored though.
>>
>> Ok.
>>
>>>

>
>>
>> Suppose I have 4 boards J1, J2, J3 & J4 on my soc "emb".of 
>> vendor "vast"
>>For this requirement I have
>>board/vast/dts/J1.dts
>>board/vast/dts/J2.dts
>>board/vast/dts/J3.dts
>>board/vast/dts/J4.dts
>>
>>include/configs/emb_common.h ==> single configuration of all 
>> SOC
>> needed definitions
>>like defconfig in Linux.
>>
>>do I need any more files?
>
> That's enough for the basics I think.

 Is dtsi file require to add it on arch folder along with above.
>>>
>>> If your architecture is not one of those already supported (like arm
>>> tegra/exynos and x86) then yes you need to add this file in
>>> arch//dts. What architecture are you using?
>>
>> My architecture is armv7, may be for me dtsi not required as arm is
>> existing architecture
>> to support fdt on u-boot.. is it?
>
> Which sub-arch? If it is tegra/exynos5250 then you might be OK. For
> something else, you should get the kernel's .dtsi file for that chip.

 I am having armv7, xilinx zynq soc..but i coun't get any .dtsi on 
 kernel source.
 may be I will create new one.
>>>
>>> OK, well if the kernel doesn't have FDT support yet then yes you will
>>> need to create a new one.
>>>

>
>>
>>>

>
>>
>>In emb_common.h i am defining
>>CONFIG_OF_SEPARATE is it sufficient?
>
> And CONFIG_OF_CONTROL
>
>>
>>My plan is to build u-boot and then build the dtb with 
>> specific
>> board and then combine.
>
> That's fine, and is how we do things on Chromium also. U-Boot 
> tries to
> build a

Re: [U-Boot] [PATCH 0/2] ARM: mmu: Set domain permissions to client access - build warnings!

2013-02-28 Thread Sricharan R

Hi Albert,

On Thursday 28 February 2013 08:35 PM, Albert ARIBAUD wrote:

On Thu, 28 Feb 2013 15:20:44 +0100, Albert ARIBAUD
  wrote:


(sorry for any duplicate of this mail)

Hi R Sricharan,

On Tue, 8 Jan 2013 23:38:22 +0530, R Sricharan
wrote:


Currently for ARM based cpu's, mmu pagetable attributes are set with
manager permissions for all 4GB address space. Because of this the
'execute never (XN)' permission is never checked on read sensitive
regions which results in speculative aborts.

This series changes the domain permissions of the full 4GB space
to client access for OMAP socs. This avoids all the speculative
aborts that are currently seen on OMAP5 secure devices.

Tested on OMAP5 SDP (HS) soc.

This series depends on [1] the patch sent by


[1] http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html

R Sricharan (2):
   ARM: mmu: Introduce weak dram_bank_setup function
   ARM: mmu: Set domain permissions to client access

  arch/arm/cpu/armv7/cache_v7.c  |3 ++
  arch/arm/cpu/armv7/omap-common/hwinit-common.c |   35 
  arch/arm/include/asm/cache.h   |1 +
  arch/arm/include/asm/system.h  |   14 ++
  arch/arm/lib/cache-cp15.c  |   13 -
  5 files changed, 65 insertions(+), 1 deletion(-)


Series applied to u-boot-arm/master, thanks!

Correction: I'd wrongly inferred from the testing done on OMAP5 that
the series would build fine. However it appears that for targets
omap4_sdp4430, omap4_panda and omap5_evm, patch 2/2 has warnings:

hwinit-common.c: In function 'dram_bank_mmu_setup':
hwinit-common.c:279:3: warning: implicit declaration of function
'set_section_dcache' [-Wimplicit-function-declaration]

Luckily, I had not committed to the git repo yet.

R Sicharan, can you please check and fix this warning?

Amicalement,

Oh, thats because as i mentioned above, it depends on the below
patch from vincent .

  http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html

I did not repost it though.  I will do it now for clarity.

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


Re: [U-Boot] Please pull u-boot-x86.git

2013-02-28 Thread Simon Glass
Hi Tom,

On Thu, Feb 28, 2013 at 4:22 PM, Simon Glass  wrote:
> Hi Tom,
>
> On Thu, Feb 28, 2013 at 3:00 PM, Tom Rini  wrote:
>> On Wed, Feb 27, 2013 at 01:18:23PM -0800, Simon Glass wrote:
>>
>>> Hi Tom,
>>>
>>> I have pulled the latest series into a branch in the x86 tree. You can
>>> also get it from patchwork. If you are happy with it, please see
>>> below. I haven't seen any comments for a few days.
>>
>> OK, building with ELDK4.2 for a number of ARM boards such as igep0030:
>> cmd_mem.c: In function 'do_mem_mtest':
>> cmd_mem.c:979: warning: passing argument 1 of 'unmap_sysmem' discards
>> qualifiers from pointer target type
>> cmd_mem.c:980: warning: passing argument 1 of 'unmap_sysmem' discards
>> qualifiers from pointer target type
>>
>
> Strange - there is even an explicit cast,. But mine is gcc 4.4.1 so
> may be a bit later. I could just remove those two lines since they are
> only there for semantic correctness and compile to nothing anyway. But
> I will track down that tool chain and see if I can work out a fix.

OK I have repeated this - it seems that the compiler does not like a
direct 'cast away' of volatile in a function argument. I have added a
work-around, and sent out an updated patch 20. You can either pull
this in from patchwork, or I have updated the pull information below.

Rather ominously this might mean that I need to start building with
multiple tool chains for each architecture. I was rather hoping to
avoid that...

Thanks for spotting it.

Regards,
Simon

>
>> Please fix and re-submit, thanks.


The following changes since commit a1eac57a2001ecf86a46f520cd85ef8e9c8b3687:

  common/env_nand.c: calculate crc only when readenv was OK
(2013-02-22 19:59:53 -0600)

are available in the git repository at:

  git://git.denx.de/u-boot-x86.git mem

for you to fetch changes up to 218da0f35f4b5e5bf13d3dba6d975d4d5d65516f:

  hash: Use lower case for hash algorithm names (2013-02-28 19:49:13 -0800)


Allen Martin (1):
  sandbox: fix compiler warning

Simon Glass (21):
  Tidy up error checking and fix bug in hash command
  Update print_buffer() to use const
  sandbox: Add un/map_sysmen() to deal with sandbox's ram_buf
  sandbox: Change memory commands to use map_physmem
  Split out the memory tests into separate functions
  Use common mtest iteration counting
  Fix mtest indenting
  Bring mtest putc() into common code
  Reduce casting in mtest
  Update set_working_fdt_addr() to use setenv_addr()
  common: Use new numeric setenv functions
  fs: Use new numeric setenv functions
  net: Use new numeric setenv functions
  image: Use crc header file instead of C prototypes
  hash: Add a flag to support saving hashes in the environment
  Roll crc32 into hash infrastructure
  sandbox: config: Enable hash functions and mtest
  Move CONFIG_SYS_MEMTEST_SCRATCH #ifdef to top of file
  sandbox: Update mtest to fix crashes
  sandbox: Allow hash functions to work correctly
  hash: Use lower case for hash algorithm names

Taylor Hutt (1):
  sandbox: Improve sandbox serial port keyboard interface

 README|   9 +
 arch/sandbox/config.mk|   1 +
 arch/sandbox/cpu/os.c |   8 +
 arch/sandbox/cpu/start.c  |   3 +
 arch/sandbox/include/asm/io.h |  10 +
 common/cmd_bootm.c|  11 +-
 common/cmd_cbfs.c |   4 +-
 common/cmd_cramfs.c   |   4 +-
 common/cmd_fdos.c |   4 +-
 common/cmd_fdt.c  |  11 +-
 common/cmd_hash.c |  14 +-
 common/cmd_jffs2.c|   4 +-
 common/cmd_load.c |  12 +-
 common/cmd_mem.c  | 809

 common/cmd_mtdparts.c |   4 +-
 common/cmd_nand.c |  12 +-
 common/cmd_nvedit.c   |  11 +-
 common/cmd_reiser.c   |   4 +-
 common/cmd_setexpr.c  |  39 +++-
 common/cmd_sha1sum.c  |   6 +-
 common/cmd_unzip.c|   4 +-
 common/cmd_ximg.c |   7 +-
 common/cmd_zfs.c  |   3 +-
 common/cmd_zip.c  |   4 +-
 common/hash.c | 194 +++-
 common/image.c|   4 +-
 drivers/net/fm/fm.c   |   4 +-
 drivers/serial/sandbox.c  |  44 +++-
 fs/fs.c   |   4 +-
 fs/ubifs/ubifs.c  |   4 +-
 include/common.h  |  29 ++-
 include/configs/sandbox.h |   9 +-
 include/hash.h|  13 +-
 include/os.h  |  10 +
 include/u-boot/crc.h  |  11 +
 lib/crc32.c   |   9 +
 lib/display_options.c |   3 +-
 net/net.c |   8 +-
 38 files changed, 761 insertions(+), 583 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Bo Shen

Hi Vipin,

On 3/1/2013 11:40, Vipin Kumar wrote:
[Snip]

Signed-off-by: Shiraz Hashim
---
drivers/net/macb.c | 38 ++
1 file changed, 34 insertions(+), 4 deletions(-)


Tested on Atmel EK board. It works.

Tested-by: Bo Shen 

BTW, would this be implemented as a workaround only for SPEAr320S?



Yes, The idea was to implement this only for spear320s
After your tested-by, I am thinking may be I can make a separate
workaround config which can be enabled by any board using this peripheral.

Is that OK?


Agree.

Best Regards,
Bo Shen

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


[U-Boot] [PATCH v5 20/22] sandbox: Update mtest to fix crashes

2013-02-28 Thread Simon Glass
Use map_sysmem() in the memory tester so that it works as expected on
sandbox.

Signed-off-by: Simon Glass 
---
Changes in v5:
- Work around ELDK4-2 "passing argument 1 of 'unmap_sysmem' discards qualifier"

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/cmd_mem.c | 108 ---
 1 file changed, 63 insertions(+), 45 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 50838a7..042c994 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -631,21 +631,19 @@ int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 }
 #endif /* CONFIG_LOOPW */
 
-static ulong mem_test_alt(ulong start_addr, ulong end_addr)
+static ulong mem_test_alt(vu_long *buf, ulong start_addr, ulong end_addr,
+ vu_long *dummy)
 {
-   vu_long *start, *end;
vu_long *addr;
ulong errs = 0;
ulong val, readback;
int j;
-   vu_long len;
vu_long offset;
vu_long test_offset;
vu_long pattern;
vu_long temp;
vu_long anti_pattern;
vu_long num_words;
-   vu_long *dummy = (vu_long *)CONFIG_SYS_MEMTEST_SCRATCH;
static const ulong bitpattern[] = {
0x0001, /* single bit */
0x0003, /* two adjacent bits */
@@ -657,8 +655,7 @@ static ulong mem_test_alt(ulong start_addr, ulong end_addr)
0x, /* alternating 1/0 */
};
 
-   start = (vu_long *)start_addr;
-   end = (vu_long *)end_addr;
+   num_words = (end_addr - start_addr) / sizeof(vu_long);
 
/*
 * Data line test: write a pattern to the first
@@ -677,11 +674,11 @@ static ulong mem_test_alt(ulong start_addr, ulong 
end_addr)
 * '0's and '0' bits through a field of '1's (i.e.
 * pattern and ~pattern).
 */
-   addr = start;
+   addr = buf;
for (j = 0; j < sizeof(bitpattern) / sizeof(bitpattern[0]); j++) {
val = bitpattern[j];
for (; val != 0; val <<= 1) {
-   *addr  = val;
+   *addr = val;
*dummy  = ~val; /* clear the test data off the bus */
readback = *addr;
if (readback != val) {
@@ -740,58 +737,56 @@ static ulong mem_test_alt(ulong start_addr, ulong 
end_addr)
 *
 * Returns: 0 if the test succeeds, 1 if the test fails.
 */
-   len = (end_addr - start_addr) / sizeof(vu_long);
pattern = (vu_long) 0x;
anti_pattern = (vu_long) 0x;
 
-   debug("%s:%d: length = 0x%.8lx\n",
-   __func__, __LINE__, len);
+   debug("%s:%d: length = 0x%.8lx\n", __func__, __LINE__, num_words);
/*
 * Write the default pattern at each of the
 * power-of-two offsets.
 */
-   for (offset = 1; offset < len; offset <<= 1)
-   start[offset] = pattern;
+   for (offset = 1; offset < num_words; offset <<= 1)
+   addr[offset] = pattern;
 
/*
 * Check for address bits stuck high.
 */
test_offset = 0;
-   start[test_offset] = anti_pattern;
+   addr[test_offset] = anti_pattern;
 
-   for (offset = 1; offset < len; offset <<= 1) {
-   temp = start[offset];
+   for (offset = 1; offset < num_words; offset <<= 1) {
+   temp = addr[offset];
if (temp != pattern) {
printf("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
" expected 0x%.8lx, actual 0x%.8lx\n",
-   (ulong)&start[offset], pattern, temp);
+   start_addr + offset, pattern, temp);
errs++;
if (ctrlc())
return -1;
}
}
-   start[test_offset] = pattern;
+   addr[test_offset] = pattern;
WATCHDOG_RESET();
 
/*
 * Check for addr bits stuck low or shorted.
 */
-   for (test_offset = 1; test_offset < len; test_offset <<= 1) {
-   start[test_offset] = anti_pattern;
+   for (test_offset = 1; test_offset < num_words; test_offset <<= 1) {
+   addr[test_offset] = anti_pattern;
 
-   for (offset = 1; offset < len; offset <<= 1) {
-   temp = start[offset];
+   for (offset = 1; offset < num_words; offset <<= 1) {
+   temp = addr[offset];
if ((temp != pattern) && (offset != test_offset)) {
printf("\nFAILURE: Address bit stuck low or"
" shorted @ 0x%.8lx: expected 0x%.8lx,"
" actual 0x%.8lx\n",
-   (ulong)&start[offset], pattern, temp);
+  

Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Vipin Kumar

On 2/28/2013 6:29 PM, Albert ARIBAUD wrote:

On Sun, 3 Feb 2013 12:19:26 +0100, Albert ARIBAUD
  wrote:


Hi Vipin,

On Fri, 2 Nov 2012 23:09:59 +0530, Vipin Kumar
wrote:


From: Shiraz Hashim

It is observed on SPEAr320S RMII#1 interface that on transmitting
packets the MAC dma hangs randomly and constantly showing busy tx-go
state.

It comes out if this situation only when Transmission is disabled and
enabled again.

Since it happens randomly and u-boot doesn't require high performance we
disable TE and re-enable it on each transmission. We also change number
of transmit descriptor to 1 as we would not require more than it, further
it would not alter GMAC notion of transmit descriptor start queue as it
always point to same descriptor.

Signed-off-by: Shiraz Hashim
---
  drivers/net/macb.c | 38 ++
  1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index ac25b52..17bad33 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -55,7 +55,7 @@

  #define CONFIG_SYS_MACB_RX_BUFFER_SIZE4096
  #define CONFIG_SYS_MACB_RX_RING_SIZE  (CONFIG_SYS_MACB_RX_BUFFER_SIZE 
/ 128)
-#define CONFIG_SYS_MACB_TX_RING_SIZE   16
+#define CONFIG_SYS_MACB_TX_RING_SIZE   1
  #define CONFIG_SYS_MACB_TX_TIMEOUT1000
  #define CONFIG_SYS_MACB_AUTONEG_TIMEOUT   500

@@ -226,7 +226,13 @@ static int macb_send(struct eth_device *netdev, void 
*packet, int length)
macb->tx_ring[tx_head].ctrl = ctrl;
macb->tx_ring[tx_head].addr = paddr;
barrier();
-   macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
+   /*
+* Due to issues on SPEAr320 RMII, disable TE first so that
+* controller can come out if it is hanged during transmission
+*/
+   macb_writel(macb, NCR, macb_readl(macb, NCR)&  ~MACB_BIT(TE));
+   macb_writel(macb, NCR, macb_readl(macb, NCR) |
+   MACB_BIT(TE) | MACB_BIT(TSTART));

/*
 * I guess this is necessary because the networking core may
@@ -444,6 +450,31 @@ static int macb_phy_init(struct macb_device *macb)
}
  }

+static void macb_reset_hw(struct macb_device *bp)
+{
+   /* Make sure we have the write buffer for ourselves */
+   barrier();
+   /*
+* Disable RX and TX (XXX: Should we halt the transmission
+* more gracefully?) and we should not close the mdio port
+*/
+   macb_writel(bp, NCR, 0);
+
+   /* Clear the stats registers (XXX: Update stats first?) */
+   macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
+
+   /* keep the mdio port , otherwise other eth will not work */
+   macb_writel(bp, NCR, MACB_BIT(MPE));
+
+   /* Clear all status flags */
+   macb_writel(bp, TSR, ~0UL);
+   macb_writel(bp, RSR, ~0UL);
+
+   /* Disable all interrupts */
+   macb_writel(bp, IDR, ~0UL);
+   macb_readl(bp, ISR);
+}
+
  static int macb_init(struct eth_device *netdev, bd_t *bd)
  {
struct macb_device *macb = to_macb(netdev);
@@ -520,8 +551,7 @@ static void macb_halt(struct eth_device *netdev)
tsr = macb_readl(macb, TSR);
} while (tsr&  MACB_BIT(TGO));

-   /* Disable TX and RX, and clear statistics */
-   macb_writel(macb, NCR, MACB_BIT(CLRSTAT));
+   macb_reset_hw(macb);
  }

  static int macb_write_hwaddr(struct eth_device *dev)


This patch did not reappear in later versions of the series, and no
other standalone patch seems to match it. Was it dropped?


Ping?



No, I have been busy with something. I would come back to the u-boot 
development soon


Vipin


Amicalement,


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


Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Vipin Kumar

On 3/1/2013 8:38 AM, Bo Shen wrote:

Hi All,

On 02/28/2013 08:59 PM, Albert ARIBAUD wrote:

On Sun, 3 Feb 2013 12:19:26 +0100, Albert ARIBAUD
 wrote:


Hi Vipin,

On Fri, 2 Nov 2012 23:09:59 +0530, Vipin Kumar
wrote:


From: Shiraz Hashim

It is observed on SPEAr320S RMII#1 interface that on transmitting
packets the MAC dma hangs randomly and constantly showing busy tx-go
state.

It comes out if this situation only when Transmission is disabled and
enabled again.

Since it happens randomly and u-boot doesn't require high
performance we
disable TE and re-enable it on each transmission. We also change number
of transmit descriptor to 1 as we would not require more than it,
further
it would not alter GMAC notion of transmit descriptor start queue as it
always point to same descriptor.

Signed-off-by: Shiraz Hashim
---
drivers/net/macb.c | 38 ++
1 file changed, 34 insertions(+), 4 deletions(-)


Tested on Atmel EK board. It works.

Tested-by: Bo Shen 

BTW, would this be implemented as a workaround only for SPEAr320S?



Yes, The idea was to implement this only for spear320s
After your tested-by, I am thinking may be I can make a separate 
workaround config which can be enabled by any board using this peripheral.


Is that OK?

Regards
Vipin

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


Re: [U-Boot] [Drivers PATCH 14/19] net/macb: workaround for transmission hang issue

2013-02-28 Thread Bo Shen

Hi All,

On 02/28/2013 08:59 PM, Albert ARIBAUD wrote:

On Sun, 3 Feb 2013 12:19:26 +0100, Albert ARIBAUD
  wrote:


Hi Vipin,

On Fri, 2 Nov 2012 23:09:59 +0530, Vipin Kumar
wrote:


From: Shiraz Hashim

It is observed on SPEAr320S RMII#1 interface that on transmitting
packets the MAC dma hangs randomly and constantly showing busy tx-go
state.

It comes out if this situation only when Transmission is disabled and
enabled again.

Since it happens randomly and u-boot doesn't require high performance we
disable TE and re-enable it on each transmission. We also change number
of transmit descriptor to 1 as we would not require more than it, further
it would not alter GMAC notion of transmit descriptor start queue as it
always point to same descriptor.

Signed-off-by: Shiraz Hashim
---
  drivers/net/macb.c | 38 ++
  1 file changed, 34 insertions(+), 4 deletions(-)


Tested on Atmel EK board. It works.

Tested-by: Bo Shen 

BTW, would this be implemented as a workaround only for SPEAr320S?

Best Regards,
Bo Shen


diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index ac25b52..17bad33 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -55,7 +55,7 @@

  #define CONFIG_SYS_MACB_RX_BUFFER_SIZE4096
  #define CONFIG_SYS_MACB_RX_RING_SIZE  (CONFIG_SYS_MACB_RX_BUFFER_SIZE 
/ 128)
-#define CONFIG_SYS_MACB_TX_RING_SIZE   16
+#define CONFIG_SYS_MACB_TX_RING_SIZE   1
  #define CONFIG_SYS_MACB_TX_TIMEOUT1000
  #define CONFIG_SYS_MACB_AUTONEG_TIMEOUT   500

@@ -226,7 +226,13 @@ static int macb_send(struct eth_device *netdev, void 
*packet, int length)
macb->tx_ring[tx_head].ctrl = ctrl;
macb->tx_ring[tx_head].addr = paddr;
barrier();
-   macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART));
+   /*
+* Due to issues on SPEAr320 RMII, disable TE first so that
+* controller can come out if it is hanged during transmission
+*/
+   macb_writel(macb, NCR, macb_readl(macb, NCR)&  ~MACB_BIT(TE));
+   macb_writel(macb, NCR, macb_readl(macb, NCR) |
+   MACB_BIT(TE) | MACB_BIT(TSTART));

/*
 * I guess this is necessary because the networking core may
@@ -444,6 +450,31 @@ static int macb_phy_init(struct macb_device *macb)
}
  }

+static void macb_reset_hw(struct macb_device *bp)
+{
+   /* Make sure we have the write buffer for ourselves */
+   barrier();
+   /*
+* Disable RX and TX (XXX: Should we halt the transmission
+* more gracefully?) and we should not close the mdio port
+*/
+   macb_writel(bp, NCR, 0);
+
+   /* Clear the stats registers (XXX: Update stats first?) */
+   macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
+
+   /* keep the mdio port , otherwise other eth will not work */
+   macb_writel(bp, NCR, MACB_BIT(MPE));
+
+   /* Clear all status flags */
+   macb_writel(bp, TSR, ~0UL);
+   macb_writel(bp, RSR, ~0UL);
+
+   /* Disable all interrupts */
+   macb_writel(bp, IDR, ~0UL);
+   macb_readl(bp, ISR);
+}
+
  static int macb_init(struct eth_device *netdev, bd_t *bd)
  {
struct macb_device *macb = to_macb(netdev);
@@ -520,8 +551,7 @@ static void macb_halt(struct eth_device *netdev)
tsr = macb_readl(macb, TSR);
} while (tsr&  MACB_BIT(TGO));

-   /* Disable TX and RX, and clear statistics */
-   macb_writel(macb, NCR, MACB_BIT(CLRSTAT));
+   macb_reset_hw(macb);
  }

  static int macb_write_hwaddr(struct eth_device *dev)


This patch did not reappear in later versions of the series, and no
other standalone patch seems to match it. Was it dropped?


Ping?

Amicalement,


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


Re: [U-Boot] [PATCH v4 0/11] Add BF60x processor support to Blackfin architecture.

2013-02-28 Thread Sonic Zhang
Hi Tom,

On Fri, Mar 1, 2013 at 5:22 AM, Tom Rini  wrote:
> On Thu, Feb 21, 2013 at 07:06:38PM +0800, Sonic Zhang wrote:
>
>> From: Sonic Zhang 
>>
>>
>> ADSP-BF60x is the new generation Blackfin?? dual-core processor announced by
>> Analog Devices in late March, 2012. This patch set adds BF60x processor 
>> support
>> to Das U-Boot Blackfin architecture.
>>
>> For more information, see http://blackfin.uclinux.org .
>>
>> Changes in v4:
>> - Remove last blank line in initcode.c.
>> - Fix all checkpatch issues except for cpu name bf609-0.0. It is use as the
>> link flags and is not an error.
>> - Remove the values for variables in bf609 config headers whose values are 
>> useless.
>> - Fix checkpatch warning whitespace before semicolon
>
> This all looks fine.  If no one else comments soon, feel free to make up
> your first pull request.
>

Thank you for your help. Because the Merge Window for the next release
(v2013.04) was closed on Feb 09, should I make up the pull request
after the (v2013.04) release on Apr. 15?


Regards,

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


Re: [U-Boot] [PATCH v3 1/4] nand: Extend nand_(read|write)_skip_bad with *actual and limit parameters

2013-02-28 Thread Scott Wood

On 02/28/2013 01:09:05 PM, Tom Rini wrote:

We make these two functions take a size_t pointer to how much space
was used on NAND to read or write the buffer (when reads/writes  
happen)

so that bad blocks can be accounted for.  We also make them take an
loff_t limit on how much data can be read or written.  This means that
we can now catch the case of when writing to a partition would exceed
the partition size due to bad blocks.  To do this we also need to make
check_skip_len count not just complete blocks used but partial ones as
well.  All callers of nand_(read|write)_skip_bad are adjusted to call
these with the most sensible limits available.

The changes were started by Pantelis and finished by Tom.

Signed-off-by: Pantelis Antoniou 
Signed-off-by: Tom Rini 
---
Changes in v3:
- Reworked skip_check_len changes to just add accounting for *used to
  the logic.
- Allow for actual to be NULL in nand_(read|write)_skip_bad, only DFU
  calls this with a non-NULL parameter.  Make sure the comments for  
both

  functions explain the parameters and their behavior.
- Other style changes requested by Scott.
- As nand_(write|read)_skip_bad passes back just a used length now.

Changes in v2:
- NAND skip_check_len changes reworked to allow
  nand_(read|write)_skip_bad to return this information to the caller.

 common/cmd_nand.c|   56  
+++

 common/env_nand.c|3 +-
 drivers/mtd/nand/nand_util.c |   67  
+-

 include/nand.h   |4 +--
 4 files changed, 93 insertions(+), 37 deletions(-)


Looks mostly good, just some minor issues:


-   if (*size > maxsize) {
-   puts("Size exceeds partition or device limit\n");
-   return -1;
-   }
-


I assume you're removing this because you rely on the read/write  
functions printing the error... what about other users of this such as  
erase, lock, etc?


@@ -476,20 +483,30 @@ static size_t drop_ffs(const nand_info_t *nand,  
const u_char *buf,

  * Write image to NAND flash.
  * Blocks that are marked bad are skipped and the is written to the  
next
  * block instead as long as the image is short enough to fit even  
after

- * skipping the bad blocks.
+ * skipping the bad blocks.  Due to bad blocks we may not be able to
+ * perform the requested write.  In the case where the write would
+ * extend beyond the end of the NAND device, both length and actual  
(if

+ * not NULL) are set to 0.  In the case where the write would extend
+ * beyond the limit we are passed, length is set to 0 and actual is  
set

+ * to the required length.
  *
  * @param nand NAND device
  * @param offset   offset in flash
  * @param length   buffer length
+ * @param actual   set to size required to write length worth of
+ * buffer or 0, if not NULL


s/or 0/or 0 on error/
or
s/or 0/in case of success/

The read function doesn't have the "or 0" comment...

+ * @param lim		maximum size that length may be in  
order to not

+ * exceed the buffer


s/that length may be/that actual may be/


  * @param bufferbuffer to read from
  * @param flags		flags modifying the behaviour of the  
write to NAND

  * @return 0 in case of success
  */
 int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t  
*length,

-   u_char *buffer, int flags)
+   size_t *actual, loff_t lim, u_char *buffer, int flags)
 {
int rval = 0, blocksize;
size_t left_to_write = *length;
+   size_t used_for_write = 0;
u_char *p_buffer = buffer;
int need_skip;

@@ -526,16 +543,28 @@ int nand_write_skip_bad(nand_info_t *nand,  
loff_t offset, size_t *length,

if ((offset & (nand->writesize - 1)) != 0) {
printf("Attempt to write non page-aligned data\n");
*length = 0;
+   if (actual)
+   *actual = 0;
return -EINVAL;
}


Again, what about the returns in the WITH_YAFFS_OOB section?  Or if we  
document that "actual" is undefined for error returns we can not worry  
about this.


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


[U-Boot] [PATCH v2 9/9] ti814x_evm: add ti814x evm board support

2013-02-28 Thread Matt Porter
Add TI814X EVM board directory, config file, and MAINTAINERS
entry. Enable build.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2:
* squash MAINTAINERS and Makefile commits here
* config file fixes (copyright, mtest, findfdt, fs options, cleanups)
* move wdtimer variable under SPL build
---
 MAINTAINERS |4 +
 Makefile|2 +-
 arch/arm/cpu/armv7/Makefile |2 +-
 arch/arm/cpu/armv7/omap-common/Makefile |2 +-
 board/ti/ti814x/Makefile|   46 +++
 board/ti/ti814x/evm.c   |  198 +++
 board/ti/ti814x/evm.h   |7 +
 board/ti/ti814x/mux.c   |   51 +++
 boards.cfg  |1 +
 include/configs/ti814x_evm.h|  223 +++
 spl/Makefile|2 +-
 11 files changed, 534 insertions(+), 4 deletions(-)
 create mode 100644 board/ti/ti814x/Makefile
 create mode 100644 board/ti/ti814x/evm.c
 create mode 100644 board/ti/ti814x/evm.h
 create mode 100644 board/ti/ti814x/mux.c
 create mode 100644 include/configs/ti814x_evm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 45e2dd4..6b2202c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -833,6 +833,10 @@ Stelian Pop 
at91sam9263ek   ARM926EJS (AT91SAM9263 SoC)
at91sam9rlekARM926EJS (AT91SAM9RL SoC)
 
+Matt Porter 
+
+   ti814x_evm  ARM ARMV7 (TI814x Soc)
+
 Dave Purdy 
 
pogo_e02ARM926EJS (Kirkwood SoC)
diff --git a/Makefile b/Makefile
index fc18dd4..7273fa4 100644
--- a/Makefile
+++ b/Makefile
@@ -330,7 +330,7 @@ LIBS-y += api/libapi.o
 LIBS-y += post/libpost.o
 LIBS-y += test/libtest.o
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
+ifneq 
($(CONFIG_AM33XX)$(CONFIG_OMAP34XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TI814X),)
 LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
 endif
 
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index ee8c2b3..c961247 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -32,7 +32,7 @@ COBJS += cache_v7.o
 COBJS  += cpu.o
 COBJS  += syslib.o
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA),)
+ifneq 
($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_TI814X),)
 SOBJS  += lowlevel_init.o
 endif
 
diff --git a/arch/arm/cpu/armv7/omap-common/Makefile 
b/arch/arm/cpu/armv7/omap-common/Makefile
index 0efc80d..55e82ba 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -36,7 +36,7 @@ COBJS += emif-common.o
 COBJS  += vc.o
 endif
 
-ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
+ifneq ($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TI814X),)
 COBJS  += boot-common.o
 SOBJS  += lowlevel_init.o
 endif
diff --git a/board/ti/ti814x/Makefile b/board/ti/ti814x/Makefile
new file mode 100644
index 000..09d2422
--- /dev/null
+++ b/board/ti/ti814x/Makefile
@@ -0,0 +1,46 @@
+#
+# Makefile
+#
+# Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+ifdef CONFIG_SPL_BUILD
+COBJS  := mux.o
+endif
+
+COBJS  += evm.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))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c
new file mode 100644
index 000..acc18fb
--- /dev/null
+++ b/board/ti/ti814x/evm.c
@@ -0,0 +1,198 @@
+/*
+ * evm.c
+ *
+ * Board functions for TI814x EVM
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later v

[U-Boot] [PATCH v2 8/9] ns16550: enable quirks for ti814x

2013-02-28 Thread Matt Porter
TI814X requires the same quirks as AM33XX to be enabled.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2: no changes
---
 drivers/serial/ns16550.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 87a0917..02bc85b 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -43,7 +43,7 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
 
serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \
-   defined(CONFIG_AM33XX)
+   defined(CONFIG_AM33XX) || defined(CONFIG_TI814X)
serial_out(0x7, &com_port->mdr1);   /* mode select reset TL16C750*/
 #endif
serial_out(UART_LCR_BKSE | UART_LCRVAL, (ulong)&com_port->lcr);
@@ -57,7 +57,8 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
serial_out((baud_divisor >> 8) & 0xff, &com_port->dlm);
serial_out(UART_LCRVAL, &com_port->lcr);
 #if (defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)) || \
-   defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX)
+   defined(CONFIG_AM33XX) || defined(CONFIG_SOC_DA8XX) || \
+   defined(CONFIG_TI814X)
 
 #if defined(CONFIG_APTIX)
/* /13 mode so Aptix 6MHz can hit 115200 */
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 7/9] am33xx: support ti814x mmc reference clock

2013-02-28 Thread Matt Porter
TI814x has a 192MHz hsmmc reference clock. Select that clock rate
when building for TI814x.

Signed-off-by: Matt Porter 

---
v2: no changes, new to the series
---
 arch/arm/include/asm/arch-am33xx/mmc_host_def.h |4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h 
b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
index 1f597c0..e0a3b8b 100644
--- a/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
+++ b/arch/arm/include/asm/arch-am33xx/mmc_host_def.h
@@ -153,7 +153,11 @@ typedef struct hsmmc {
 #define MMC_CMD0   (INDEX(0) | RSP_TYPE_NONE | DP_NO_DATA | DDIR_WRITE)
 
 /* Clock Configurations and Macros */
+#ifdef CONFIG_AM33XX
 #define MMC_CLOCK_REFERENCE96 /* MHz */
+#elif defined(CONFIG_TI814X)
+#define MMC_CLOCK_REFERENCE192 /* MHz */
+#endif
 
 #define mmc_reg_out(addr, mask, val)\
writel((readl(addr) & (~(mask))) | ((val) & (mask)), (addr))
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 6/9] am33xx: add dmm support to emif4 library

2013-02-28 Thread Matt Porter
Adds a config_dmm() routine to support TI814X DMM configuration.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2: no changes
---
 arch/arm/cpu/armv7/am33xx/emif4.c   |   17 +
 arch/arm/include/asm/arch-am33xx/ddr_defs.h |5 +
 2 files changed, 22 insertions(+)

diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c 
b/arch/arm/cpu/armv7/am33xx/emif4.c
index 0c617fa..27547be 100644
--- a/arch/arm/cpu/armv7/am33xx/emif4.c
+++ b/arch/arm/cpu/armv7/am33xx/emif4.c
@@ -44,11 +44,28 @@ void dram_init_banksize(void)
 
 
 #ifdef CONFIG_SPL_BUILD
+static struct dmm_lisa_map_regs *hw_lisa_map_regs =
+   (struct dmm_lisa_map_regs *)DMM_BASE;
 static struct vtp_reg *vtpreg[2] = {
(struct vtp_reg *)VTP0_CTRL_ADDR,
(struct vtp_reg *)VTP1_CTRL_ADDR};
 static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR;
 
+void config_dmm(const struct dmm_lisa_map_regs *regs)
+{
+   enable_dmm_clocks();
+
+   writel(0, &hw_lisa_map_regs->dmm_lisa_map_3);
+   writel(0, &hw_lisa_map_regs->dmm_lisa_map_2);
+   writel(0, &hw_lisa_map_regs->dmm_lisa_map_1);
+   writel(0, &hw_lisa_map_regs->dmm_lisa_map_0);
+
+   writel(regs->dmm_lisa_map_3, &hw_lisa_map_regs->dmm_lisa_map_3);
+   writel(regs->dmm_lisa_map_2, &hw_lisa_map_regs->dmm_lisa_map_2);
+   writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1);
+   writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0);
+}
+
 static void config_vtp(int nr)
 {
writel(readl(&vtpreg[nr]->vtp0ctrlreg) | VTP_CTRL_ENABLE,
diff --git a/arch/arm/include/asm/arch-am33xx/ddr_defs.h 
b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
index 1cbadff..15ca4c1 100644
--- a/arch/arm/include/asm/arch-am33xx/ddr_defs.h
+++ b/arch/arm/include/asm/arch-am33xx/ddr_defs.h
@@ -100,6 +100,11 @@
 #define MT41J512M8RH125_IOCTRL_VALUE   0x18B
 
 /**
+ * Configure DMM
+ */
+void config_dmm(const struct dmm_lisa_map_regs *regs);
+
+/**
  * Configure SDRAM
  */
 void config_sdram(const struct emif_regs *regs, int nr);
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 5/9] am33xx: add ti814x specific register definitions

2013-02-28 Thread Matt Porter
Support the ti814x specific register definitions within
arch-am33xx.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2: Update for hardware.h split
---
 arch/arm/cpu/armv7/am33xx/sys_info.c   |3 +++
 arch/arm/include/asm/arch-am33xx/cpu.h |   11 +
 arch/arm/include/asm/arch-am33xx/hardware.h|   21 -
 arch/arm/include/asm/arch-am33xx/hardware_am33xx.h |   24 
 arch/arm/include/asm/arch-am33xx/hardware_ti814x.h |   23 +++
 arch/arm/include/asm/arch-am33xx/omap.h|7 ++
 arch/arm/include/asm/arch-am33xx/spl.h |5 
 7 files changed, 73 insertions(+), 21 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c 
b/arch/arm/cpu/armv7/am33xx/sys_info.c
index 507b618..402127c 100644
--- a/arch/arm/cpu/armv7/am33xx/sys_info.c
+++ b/arch/arm/cpu/armv7/am33xx/sys_info.c
@@ -98,6 +98,9 @@ int print_cpuinfo(void)
case AM335X:
cpu_s = "AM335X";
break;
+   case TI81XX:
+   cpu_s = "TI81XX";
+   break;
default:
cpu_s = "Unknown cpu type";
break;
diff --git a/arch/arm/include/asm/arch-am33xx/cpu.h 
b/arch/arm/include/asm/arch-am33xx/cpu.h
index 16e8a80..3d3a7c8 100644
--- a/arch/arm/include/asm/arch-am33xx/cpu.h
+++ b/arch/arm/include/asm/arch-am33xx/cpu.h
@@ -42,9 +42,10 @@
 #define HS_DEVICE  0x2
 #define GP_DEVICE  0x3
 
-/* cpu-id for AM33XX family */
+/* cpu-id for AM33XX and TI81XX family */
 #define AM335X 0xB944
-#define DEVICE_ID  0x44E10600
+#define TI81XX 0xB81E
+#define DEVICE_ID  (CTRL_BASE + 0x0600)
 
 /* This gives the status of the boot mode pins on the evm */
 #define SYSBOOT_MASK   (BIT(0) | BIT(1) | BIT(2)\
@@ -52,9 +53,11 @@
 
 /* Reset control */
 #ifdef CONFIG_AM33XX
-#define PRM_RSTCTRL0x44E00F00
-#define PRM_RSTST  0x44E00F08
+#define PRM_RSTCTRL(PRCM_BASE + 0x0F00)
+#elif defined(CONFIG_TI814X)
+#define PRM_RSTCTRL(PRCM_BASE + 0x00A0)
 #endif
+#define PRM_RSTST  (PRM_RSTCTRL + 8)
 #define PRM_RSTCTRL_RESET  0x01
 #define PRM_RSTST_WARM_RESET_MASK  0x232
 
diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h 
b/arch/arm/include/asm/arch-am33xx/hardware.h
index 24a9b8d..5a27f9c 100644
--- a/arch/arm/include/asm/arch-am33xx/hardware.h
+++ b/arch/arm/include/asm/arch-am33xx/hardware.h
@@ -19,6 +19,7 @@
 #ifndef __AM33XX_HARDWARE_H
 #define __AM33XX_HARDWARE_H
 
+#include 
 #include 
 #ifdef CONFIG_AM33XX
 #include 
@@ -26,8 +27,9 @@
 #include 
 #endif
 
-/* Module base addresses */
-#define UART0_BASE 0x44E09000
+/*
+ * Common hardware definitions
+ */
 
 /* DM Timer base addresses */
 #define DM_TIMER0_BASE 0x4802C000
@@ -42,21 +44,10 @@
 /* GPIO Base address */
 #define GPIO0_BASE 0x48032000
 #define GPIO1_BASE 0x4804C000
-#define GPIO2_BASE 0x481AC000
 
 /* BCH Error Location Module */
 #define ELM_BASE   0x4808
 
-/* Watchdog Timer */
-#define WDT_BASE   0x44E35000
-
-/* Control Module Base Address */
-#define CTRL_BASE  0x44E1
-#define CTRL_DEVICE_BASE   0x44E10600
-
-/* PRCM Base Address */
-#define PRCM_BASE  0x44E0
-
 /* EMIF Base address */
 #define EMIF4_0_CFG_BASE   0x4C00
 #define EMIF4_1_CFG_BASE   0x4D00
@@ -90,10 +81,6 @@
 
 /* CPSW Config space */
 #define CPSW_BASE  0x4A10
-#define CPSW_MDIO_BASE 0x4A101000
-
-/* RTC base address */
-#define RTC_BASE   0x44E3E000
 
 /* OTG */
 #define USB0_OTG_BASE  0x47401000
diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h 
b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
index 7a4070c..fa02f19 100644
--- a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
+++ b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
@@ -19,6 +19,24 @@
 #ifndef __AM33XX_HARDWARE_AM33XX_H
 #define __AM33XX_HARDWARE_AM33XX_H
 
+/* Module base addresses */
+
+/* UART Base Address */
+#define UART0_BASE 0x44E09000
+
+/* GPIO Base address */
+#define GPIO2_BASE 0x481AC000
+
+/* Watchdog Timer */
+#define WDT_BASE   0x44E35000
+
+/* Control Module Base Address */
+#define CTRL_BASE  0x44E1
+#define CTRL_DEVICE_BASE   0x44E10600
+
+/* PRCM Base Address */
+#define PRCM_BASE  0x44E0
+
 /* VTP Base address */
 #define VTP0_CTRL_ADDR 0x44E10E0C
 
@@ -27,4 +45,10 @@
 #define DDR_PHY_DATA_ADDR  0x44E120C8

[U-Boot] [PATCH v2 2/9] am33xx: refactor emif4/ddr to support multiple EMIF instances

2013-02-28 Thread Matt Porter
The AM33xx emif4/ddr support closely matches what is need to support
TI814x except that TI814x has two EMIF instances. Refactor all the
emif4 helper calls and the config_ddr() init function to use an
additional instance number argument.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2:
* fix bad cast causing ddr.c warnings
* Split hardware.h -> hardware_am33xx.h/ti814x.h
---
 arch/arm/cpu/armv7/am33xx/ddr.c|   99 
 arch/arm/cpu/armv7/am33xx/emif4.c  |   38 
 arch/arm/include/asm/arch-am33xx/ddr_defs.h|   52 --
 arch/arm/include/asm/arch-am33xx/hardware.h|   13 ++-
 arch/arm/include/asm/arch-am33xx/hardware_am33xx.h |   30 ++
 arch/arm/include/asm/arch-am33xx/hardware_ti814x.h |   30 ++
 board/ti/am335x/board.c|6 +-
 7 files changed, 197 insertions(+), 71 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
 create mode 100644 arch/arm/include/asm/arch-am33xx/hardware_ti814x.h

diff --git a/arch/arm/cpu/armv7/am33xx/ddr.c b/arch/arm/cpu/armv7/am33xx/ddr.c
index fd9fc4a..4b771c8 100644
--- a/arch/arm/cpu/armv7/am33xx/ddr.c
+++ b/arch/arm/cpu/armv7/am33xx/ddr.c
@@ -24,15 +24,20 @@ http://www.ti.com/
 /**
  * Base address for EMIF instances
  */
-static struct emif_reg_struct *emif_reg = {
-   (struct emif_reg_struct *)EMIF4_0_CFG_BASE};
+static struct emif_reg_struct *emif_reg[2] = {
+   (struct emif_reg_struct *)EMIF4_0_CFG_BASE,
+   (struct emif_reg_struct *)EMIF4_1_CFG_BASE};
 
 /**
- * Base address for DDR instance
+ * Base addresses for DDR PHY cmd/data regs
  */
-static struct ddr_regs *ddr_reg[2] = {
-   (struct ddr_regs *)DDR_PHY_BASE_ADDR,
-   (struct ddr_regs *)DDR_PHY_BASE_ADDR2};
+static struct ddr_cmd_regs *ddr_cmd_reg[2] = {
+   (struct ddr_cmd_regs *)DDR_PHY_CMD_ADDR,
+   (struct ddr_cmd_regs *)DDR_PHY_CMD_ADDR2};
+
+static struct ddr_data_regs *ddr_data_reg[2] = {
+   (struct ddr_data_regs *)DDR_PHY_DATA_ADDR,
+   (struct ddr_data_regs *)DDR_PHY_DATA_ADDR2};
 
 /**
  * Base address for ddr io control instances
@@ -43,70 +48,84 @@ static struct ddr_cmdtctrl *ioctrl_reg = {
 /**
  * Configure SDRAM
  */
-void config_sdram(const struct emif_regs *regs)
+void config_sdram(const struct emif_regs *regs, int nr)
 {
-   writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl);
-   writel(regs->ref_ctrl, &emif_reg->emif_sdram_ref_ctrl_shdw);
+   writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
+   writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
if (regs->zq_config){
-   writel(regs->zq_config, &emif_reg->emif_zq_config);
+   writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
}
-   writel(regs->sdram_config, &emif_reg->emif_sdram_config);
+   writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
 }
 
 /**
  * Set SDRAM timings
  */
-void set_sdram_timings(const struct emif_regs *regs)
+void set_sdram_timings(const struct emif_regs *regs, int nr)
 {
-   writel(regs->sdram_tim1, &emif_reg->emif_sdram_tim_1);
-   writel(regs->sdram_tim1, &emif_reg->emif_sdram_tim_1_shdw);
-   writel(regs->sdram_tim2, &emif_reg->emif_sdram_tim_2);
-   writel(regs->sdram_tim2, &emif_reg->emif_sdram_tim_2_shdw);
-   writel(regs->sdram_tim3, &emif_reg->emif_sdram_tim_3);
-   writel(regs->sdram_tim3, &emif_reg->emif_sdram_tim_3_shdw);
+   writel(regs->sdram_tim1, &emif_reg[nr]->emif_sdram_tim_1);
+   writel(regs->sdram_tim1, &emif_reg[nr]->emif_sdram_tim_1_shdw);
+   writel(regs->sdram_tim2, &emif_reg[nr]->emif_sdram_tim_2);
+   writel(regs->sdram_tim2, &emif_reg[nr]->emif_sdram_tim_2_shdw);
+   writel(regs->sdram_tim3, &emif_reg[nr]->emif_sdram_tim_3);
+   writel(regs->sdram_tim3, &emif_reg[nr]->emif_sdram_tim_3_shdw);
 }
 
 /**
  * Configure DDR PHY
  */
-void config_ddr_phy(const struct emif_regs *regs)
+void config_ddr_phy(const struct emif_regs *regs, int nr)
 {
-   writel(regs->emif_ddr_phy_ctlr_1, &emif_reg->emif_ddr_phy_ctrl_1);
-   writel(regs->emif_ddr_phy_ctlr_1, &emif_reg->emif_ddr_phy_ctrl_1_shdw);
+   writel(regs->emif_ddr_phy_ctlr_1,
+   &emif_reg[nr]->emif_ddr_phy_ctrl_1);
+   writel(regs->emif_ddr_phy_ctlr_1,
+   &emif_reg[nr]->emif_ddr_phy_ctrl_1_shdw);
 }
 
 /**
  * Configure DDR CMD control registers
  */
-void config_cmd_ctrl(const struct cmd_control *cmd)
+void config_cmd_ctrl(const struct cmd_control *cmd, int nr)
 {
-   writel(cmd->cmd0csratio, &ddr_reg[0]->cm0csratio);
-   writel(cmd->cmd0dldiff, &ddr_

[U-Boot] [PATCH v2 4/9] am33xx: refactor am33xx mux support and add ti814x support

2013-02-28 Thread Matt Porter
AM33XX and TI814X have a similar mux though the pinmux register
layout and address space differ. Add a separate ti814x mux include
to support the TI814X-specific differences.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 
Acked-by: Peter Korsgaard 

---
v2:
* fixed copyright date and file header
* rename split mux includes for consistency
---
 arch/arm/include/asm/arch-am33xx/mux.h|  235 +--
 arch/arm/include/asm/arch-am33xx/mux_am33xx.h |  247 
 arch/arm/include/asm/arch-am33xx/mux_ti814x.h |  311 +
 3 files changed, 566 insertions(+), 227 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-am33xx/mux_am33xx.h
 create mode 100644 arch/arm/include/asm/arch-am33xx/mux_ti814x.h

diff --git a/arch/arm/include/asm/arch-am33xx/mux.h 
b/arch/arm/include/asm/arch-am33xx/mux.h
index 460ac1c..1c6b65f 100644
--- a/arch/arm/include/asm/arch-am33xx/mux.h
+++ b/arch/arm/include/asm/arch-am33xx/mux.h
@@ -1,7 +1,7 @@
 /*
  * mux.h
  *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -19,234 +19,15 @@
 #include 
 #include 
 
-#define MUX_CFG(value, offset) \
-   __raw_writel(value, (CTRL_BASE + offset));
-
-/* PAD Control Fields */
-#define SLEWCTRL   (0x1 << 6)
-#define RXACTIVE   (0x1 << 5)
-#define PULLDOWN_EN(0x0 << 4) /* Pull Down Selection */
-#define PULLUP_EN  (0x1 << 4) /* Pull Up Selection */
-#define PULLUDEN   (0x0 << 3) /* Pull up enabled */
-#define PULLUDDIS  (0x1 << 3) /* Pull up disabled */
-#define MODE(val)  val /* used for Readability */
-
-/*
- * PAD CONTROL OFFSETS
- * Field names corresponds to the pad signal name
- */
-struct pad_signals {
-   int gpmc_ad0;
-   int gpmc_ad1;
-   int gpmc_ad2;
-   int gpmc_ad3;
-   int gpmc_ad4;
-   int gpmc_ad5;
-   int gpmc_ad6;
-   int gpmc_ad7;
-   int gpmc_ad8;
-   int gpmc_ad9;
-   int gpmc_ad10;
-   int gpmc_ad11;
-   int gpmc_ad12;
-   int gpmc_ad13;
-   int gpmc_ad14;
-   int gpmc_ad15;
-   int gpmc_a0;
-   int gpmc_a1;
-   int gpmc_a2;
-   int gpmc_a3;
-   int gpmc_a4;
-   int gpmc_a5;
-   int gpmc_a6;
-   int gpmc_a7;
-   int gpmc_a8;
-   int gpmc_a9;
-   int gpmc_a10;
-   int gpmc_a11;
-   int gpmc_wait0;
-   int gpmc_wpn;
-   int gpmc_be1n;
-   int gpmc_csn0;
-   int gpmc_csn1;
-   int gpmc_csn2;
-   int gpmc_csn3;
-   int gpmc_clk;
-   int gpmc_advn_ale;
-   int gpmc_oen_ren;
-   int gpmc_wen;
-   int gpmc_be0n_cle;
-   int lcd_data0;
-   int lcd_data1;
-   int lcd_data2;
-   int lcd_data3;
-   int lcd_data4;
-   int lcd_data5;
-   int lcd_data6;
-   int lcd_data7;
-   int lcd_data8;
-   int lcd_data9;
-   int lcd_data10;
-   int lcd_data11;
-   int lcd_data12;
-   int lcd_data13;
-   int lcd_data14;
-   int lcd_data15;
-   int lcd_vsync;
-   int lcd_hsync;
-   int lcd_pclk;
-   int lcd_ac_bias_en;
-   int mmc0_dat3;
-   int mmc0_dat2;
-   int mmc0_dat1;
-   int mmc0_dat0;
-   int mmc0_clk;
-   int mmc0_cmd;
-   int mii1_col;
-   int mii1_crs;
-   int mii1_rxerr;
-   int mii1_txen;
-   int mii1_rxdv;
-   int mii1_txd3;
-   int mii1_txd2;
-   int mii1_txd1;
-   int mii1_txd0;
-   int mii1_txclk;
-   int mii1_rxclk;
-   int mii1_rxd3;
-   int mii1_rxd2;
-   int mii1_rxd1;
-   int mii1_rxd0;
-   int rmii1_refclk;
-   int mdio_data;
-   int mdio_clk;
-   int spi0_sclk;
-   int spi0_d0;
-   int spi0_d1;
-   int spi0_cs0;
-   int spi0_cs1;
-   int ecap0_in_pwm0_out;
-   int uart0_ctsn;
-   int uart0_rtsn;
-   int uart0_rxd;
-   int uart0_txd;
-   int uart1_ctsn;
-   int uart1_rtsn;
-   int uart1_rxd;
-   int uart1_txd;
-   int i2c0_sda;
-   int i2c0_scl;
-   int mcasp0_aclkx;
-   int mcasp0_fsx;
-   int mcasp0_axr0;
-   int mcasp0_ahclkr;
-   int mcasp0_aclkr;
-   int mcasp0_fsr;
-   int mcasp0_axr1;
-   int mcasp0_ahclkx;
-   int xdma_event_intr0;
-   int xdma_event_intr1;
-   int nresetin_out;
-   int porz;
-   int nnmi;
-   int osc0_in;
-   int osc0_out;
-   int rsvd1;
-   int tms;
-   int tdi;
-   int tdo;
-   int tck;
-   int ntrst;
-   int emu0;
-   int emu1;
-   int osc1_in;
-   int osc1_out;
-   int pmic_power_en;
-   int rtc_porz;
-   int rsvd2;
-   int ext_wakeup;
-   int enz_kaldo_1p8v;
-   int usb0_dm;
-   int usb0_dp;
-   int usb0_ce;
-   int usb0_id;
- 

[U-Boot] [PATCH v2 3/9] am33xx: refactor am33xx clocks and add ti814x support

2013-02-28 Thread Matt Porter
Split clock.c for am335x and ti814x and add ti814x specific
clock support.

Signed-off-by: Matt Porter 

---
v2:
* remove unused dmtimer support
* add register structs bit definitions
* rename soc-specific clock files for consistency
* move ti814x specific defs to clock_ti814x.c
* move am335x specific defs to clock_am335x.c
* fix copyright date
* remove clocks_*.h and go back to clock.h
---
 arch/arm/cpu/armv7/am33xx/Makefile |3 +-
 .../cpu/armv7/am33xx/{clock.c => clock_am33xx.c}   |   34 +-
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c   |  408 
 arch/arm/include/asm/arch-am33xx/clock.h   |2 +-
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h   |   33 +-
 5 files changed, 445 insertions(+), 35 deletions(-)
 rename arch/arm/cpu/armv7/am33xx/{clock.c => clock_am33xx.c} (91%)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clock_ti814x.c

diff --git a/arch/arm/cpu/armv7/am33xx/Makefile 
b/arch/arm/cpu/armv7/am33xx/Makefile
index 70c443e..c97e30d 100644
--- a/arch/arm/cpu/armv7/am33xx/Makefile
+++ b/arch/arm/cpu/armv7/am33xx/Makefile
@@ -16,7 +16,8 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(SOC).o
 
-COBJS  += clock.o
+COBJS-$(CONFIG_AM33XX) += clock_am33xx.o
+COBJS-$(CONFIG_TI814X) += clock_ti814x.o
 COBJS  += sys_info.o
 COBJS  += mem.o
 COBJS  += ddr.o
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
similarity index 91%
rename from arch/arm/cpu/armv7/am33xx/clock.c
rename to arch/arm/cpu/armv7/am33xx/clock_am33xx.c
index d7d98d1..65cb9f8 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
@@ -1,9 +1,9 @@
 /*
- * clock.c
+ * clock_am33xx.c
  *
  * clocks for AM33XX based boards
  *
- * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2013, Texas Instruments, Incorporated - http://www.ti.com/
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -42,6 +42,36 @@
 #define CPGMAC0_IDLE   0x3
 #define DPLL_CLKDCOLDO_GATE_CTRL0x300
 
+#define OSC(V_OSCK/100)
+
+/* MAIN PLL Fdll = 550 MHZ, */
+#define MPUPLL_M   550
+#define MPUPLL_N   (OSC-1)
+#define MPUPLL_M2  1
+
+/* Core PLL Fdll = 1 GHZ, */
+#define COREPLL_M  1000
+#define COREPLL_N  (OSC-1)
+
+#define COREPLL_M4 10  /* CORE_CLKOUTM4 = 200 MHZ */
+#define COREPLL_M5 8   /* CORE_CLKOUTM5 = 250 MHZ */
+#define COREPLL_M6 4   /* CORE_CLKOUTM6 = 500 MHZ */
+
+/*
+ * USB PHY clock is 960 MHZ. Since, this comes directly from Fdll, Fdll
+ * frequency needs to be set to 960 MHZ. Hence,
+ * For clkout = 192 MHZ, Fdll = 960 MHZ, divider values are given below
+ */
+#define PERPLL_M   960
+#define PERPLL_N   (OSC-1)
+#define PERPLL_M2  5
+
+/* DDR Freq is 266 MHZ for now */
+/* Set Fdll = 400 MHZ , Fdll = M * 2 * CLKINP/ N + 1; clkout = Fdll /(2 * M2) 
*/
+#define DDRPLL_M   266
+#define DDRPLL_N   (OSC-1)
+#define DDRPLL_M2  1
+
 const struct cm_perpll *cmper = (struct cm_perpll *)CM_PER;
 const struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
 const struct cm_dpll *cmdpll = (struct cm_dpll *)CM_DPLL;
diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c 
b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
new file mode 100644
index 000..a85241a
--- /dev/null
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
@@ -0,0 +1,408 @@
+/*
+ * clock_ti814x.c
+ *
+ * Clocks for TI814X based boards
+ *
+ * Copyright (C) 2013, Texas Instruments, Incorporated
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* PRCM */
+#define PRCM_MOD_EN0x2
+
+/* CLK_SRC */
+#define OSC_SRC0   0
+#define OSC_SRC1   1
+
+#define L3_OSC_SRC OSC_SRC0
+
+#define OSC_0_FREQ 20
+
+#define DCO_HS2_MIN500
+#define DCO_HS2_MAX1000
+#define DCO_HS1_MIN1000
+#define DCO_HS1_MAX2000
+
+#define SELFREQDCO_HS2 0x0801
+#define SELFREQDCO_HS1 0x1001
+
+#define MPU_N  0x1
+#define MPU_M  0x3C
+#define MPU_M2 1
+#define MPU_CLKCTRL0x1
+
+#define L3_N   19
+#define L3_M   880
+#define L3_M2  4
+#define L3_CLKCTRL 0x801
+
+

[U-Boot] [PATCH v2 0/9] Add TI814x EVM Support

2013-02-28 Thread Matt Porter
This series adds support for the PG1.0 TI814x EVM board. TI814x
fits into the existing AM33XX SoC support with some refactoring
of the AM33XX-specific emif4, clock, and mux code.

It has been tested booting up a Linux kernel and regression tested
on BeagleBone and EVM-SK AM33XX boards.

Changes since v1:
- Fix warnings in ddr.c
- Split hardware.h -> hardware_am33xx.h/ti814x.h
- Remove unused dmtimer support
- Add register structs bit definitions
- Rename soc-specific clock files for consistency
- Move soc-specific defs only used in one place to clock_*.c
- fix copyright dates and filenames in headers
- remove clocks_*.h and go back to clock.h
- Rename mux includes for consistency
- Correct mmc reference clock for ti814x
- Squash MAINTAINERS and build bits to board support commit
- Config fixes (copyright, mtest, findfdt, fs options, cleanups)
- Fix wdtimer warning

Matt Porter (9):
  am33xx: convert defines from am33xx-specific to generic names
  am33xx: refactor emif4/ddr to support multiple EMIF instances
  am33xx: refactor am33xx clocks and add ti814x support
  am33xx: refactor am33xx mux support and add ti814x support
  am33xx: add ti814x specific register definitions
  am33xx: add dmm support to emif4 library
  am33xx: support ti814x mmc reference clock
  ns16550: enable quirks for ti814x
  ti814x_evm: add ti814x evm board support

 MAINTAINERS|4 +
 Makefile   |2 +-
 arch/arm/cpu/armv7/Makefile|2 +-
 arch/arm/cpu/armv7/am33xx/Makefile |3 +-
 arch/arm/cpu/armv7/am33xx/board.c  |4 +-
 .../cpu/armv7/am33xx/{clock.c => clock_am33xx.c}   |   34 +-
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c   |  408 
 arch/arm/cpu/armv7/am33xx/ddr.c|   99 +++--
 arch/arm/cpu/armv7/am33xx/emif4.c  |   55 ++-
 arch/arm/cpu/armv7/am33xx/sys_info.c   |3 +
 arch/arm/cpu/armv7/omap-common/Makefile|2 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |2 +-
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h   |   33 +-
 arch/arm/include/asm/arch-am33xx/cpu.h |   11 +-
 arch/arm/include/asm/arch-am33xx/ddr_defs.h|   57 ++-
 arch/arm/include/asm/arch-am33xx/hardware.h|   40 +-
 arch/arm/include/asm/arch-am33xx/hardware_am33xx.h |   54 +++
 arch/arm/include/asm/arch-am33xx/hardware_ti814x.h |   53 +++
 arch/arm/include/asm/arch-am33xx/mmc_host_def.h|4 +
 arch/arm/include/asm/arch-am33xx/mux.h |  235 +--
 arch/arm/include/asm/arch-am33xx/mux_am33xx.h  |  247 
 arch/arm/include/asm/arch-am33xx/mux_ti814x.h  |  311 +++
 arch/arm/include/asm/arch-am33xx/omap.h|7 +
 arch/arm/include/asm/arch-am33xx/spl.h |5 +
 board/ti/am335x/board.c|   12 +-
 board/ti/ti814x/Makefile   |   46 +++
 board/ti/ti814x/evm.c  |  198 ++
 board/ti/ti814x/evm.h  |7 +
 board/ti/ti814x/mux.c  |   51 +++
 boards.cfg |1 +
 drivers/serial/ns16550.c   |5 +-
 include/configs/ti814x_evm.h   |  223 +++
 spl/Makefile   |2 +-
 33 files changed, 1852 insertions(+), 368 deletions(-)
 rename arch/arm/cpu/armv7/am33xx/{clock.c => clock_am33xx.c} (91%)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clock_ti814x.c
 create mode 100644 arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
 create mode 100644 arch/arm/include/asm/arch-am33xx/hardware_ti814x.h
 create mode 100644 arch/arm/include/asm/arch-am33xx/mux_am33xx.h
 create mode 100644 arch/arm/include/asm/arch-am33xx/mux_ti814x.h
 create mode 100644 board/ti/ti814x/Makefile
 create mode 100644 board/ti/ti814x/evm.c
 create mode 100644 board/ti/ti814x/evm.h
 create mode 100644 board/ti/ti814x/mux.c
 create mode 100644 include/configs/ti814x_evm.h

-- 
1.7.9.5

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


[U-Boot] [PATCH v2 1/9] am33xx: convert defines from am33xx-specific to generic names

2013-02-28 Thread Matt Porter
Eliminate AM33xx specific names to prepare for TI814x support
within AM33xx-land.

Signed-off-by: Matt Porter 
Reviewed-by: Tom Rini 

---
v2: no changes
---
 arch/arm/cpu/armv7/am33xx/board.c   |4 ++--
 arch/arm/include/asm/arch-am33xx/hardware.h |   10 +-
 board/ti/am335x/board.c |6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index ab31326..b186b32 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -141,11 +141,11 @@ int arch_misc_init(void)
 {
 #ifdef CONFIG_AM335X_USB0
musb_register(&otg0_plat, &otg0_board_data,
-   (void *)AM335X_USB0_OTG_BASE);
+   (void *)USB0_OTG_BASE);
 #endif
 #ifdef CONFIG_AM335X_USB1
musb_register(&otg1_plat, &otg1_board_data,
-   (void *)AM335X_USB1_OTG_BASE);
+   (void *)USB1_OTG_BASE);
 #endif
return 0;
 }
diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h 
b/arch/arm/include/asm/arch-am33xx/hardware.h
index 6dd3296..7016e25 100644
--- a/arch/arm/include/asm/arch-am33xx/hardware.h
+++ b/arch/arm/include/asm/arch-am33xx/hardware.h
@@ -84,14 +84,14 @@
 #define GPMC_BASE  0x5000
 
 /* CPSW Config space */
-#define AM335X_CPSW_BASE   0x4A10
-#define AM335X_CPSW_MDIO_BASE  0x4A101000
+#define CPSW_BASE  0x4A10
+#define CPSW_MDIO_BASE 0x4A101000
 
 /* RTC base address */
-#define AM335X_RTC_BASE0x44E3E000
+#define RTC_BASE   0x44E3E000
 
 /* OTG */
-#define AM335X_USB0_OTG_BASE   0x47401000
-#define AM335X_USB1_OTG_BASE   0x47401800
+#define USB0_OTG_BASE  0x47401000
+#define USB1_OTG_BASE  0x47401800
 
 #endif /* __AM33XX_HARDWARE_H */
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 48e6896..0948889 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -134,7 +134,7 @@ static int read_eeprom(void)
 
 static void rtc32k_enable(void)
 {
-   struct rtc_regs *rtc = (struct rtc_regs *)AM335X_RTC_BASE;
+   struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
 
/*
 * Unlock the RTC's registers.  For more details please see the
@@ -411,8 +411,8 @@ static struct cpsw_slave_data cpsw_slaves[] = {
 };
 
 static struct cpsw_platform_data cpsw_data = {
-   .mdio_base  = AM335X_CPSW_MDIO_BASE,
-   .cpsw_base  = AM335X_CPSW_BASE,
+   .mdio_base  = CPSW_MDIO_BASE,
+   .cpsw_base  = CPSW_BASE,
.mdio_div   = 0xff,
.channels   = 8,
.cpdma_reg_ofs  = 0x800,
-- 
1.7.9.5

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


[U-Boot] [PATCH] cmd_part: don't print cmd name twice in help

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

The core implementation of "help" already prints the command name before
the help text of a specific command. Remove it from part's own help text
to avoid it being printed twice:

Tegra114 (Dalmore) # help part
part - disk partition related commands

Usage:
part part uuid  :
- print partition UUID
...

Signed-off-by: Stephen Warren 
---
 common/cmd_part.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/cmd_part.c b/common/cmd_part.c
index d997597..b79f074 100644
--- a/common/cmd_part.c
+++ b/common/cmd_part.c
@@ -96,7 +96,7 @@ int do_part(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 U_BOOT_CMD(
part,   5,  1,  do_part,
"disk partition related commands",
-   "part uuid  :\n"
+   "uuid  :\n"
"- print partition UUID\n"
"part uuid  : \n"
"- set environment variable to partition UUID\n"
-- 
1.7.10.4

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


[U-Boot] [PATCH V2 4/4] ARM: tegra: enable a common set of disk-related commands everywhere

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

Enable a common set of partition types, filesystems, and related
commands in tegra-common.h, so that they are available on all Tegra
boards. This allows boot.scr (loaded and executed by the default
built-in environment) on those boards to assume that certain features
are always available.

Do this in tegra-common.h, so that individual board files can undefine
the features if they really don't want any of them.

Signed-off-by: Stephen Warren 
---
v2: Reworked to avoid compilation issues on Dalmore, and enable all
features on all Tegra boards.
---
 include/configs/cardhu.h   |8 
 include/configs/colibri_t20_iris.h |6 --
 include/configs/harmony.h  |8 
 include/configs/medcom-wide.h  |5 -
 include/configs/paz00.h|8 
 include/configs/plutux.h   |5 -
 include/configs/seaboard.h |8 
 include/configs/tec.h  |5 -
 include/configs/tegra-common.h |   12 
 include/configs/tegra20-common.h   |3 ---
 include/configs/trimslice.h|8 
 include/configs/ventana.h  |8 
 include/configs/whistler.h |8 
 13 files changed, 12 insertions(+), 80 deletions(-)

diff --git a/include/configs/cardhu.h b/include/configs/cardhu.h
index 18c7eb8..55dc83d 100644
--- a/include/configs/cardhu.h
+++ b/include/configs/cardhu.h
@@ -53,14 +53,6 @@
 #define CONFIG_TEGRA_MMC
 #define CONFIG_CMD_MMC
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_FS_EXT4
-#define CONFIG_FS_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_ENV_OFFSET  ((512 * 1024) - CONFIG_ENV_SIZE)
diff --git a/include/configs/colibri_t20_iris.h 
b/include/configs/colibri_t20_iris.h
index 0e5f281..856c860 100644
--- a/include/configs/colibri_t20_iris.h
+++ b/include/configs/colibri_t20_iris.h
@@ -40,12 +40,6 @@
 #define CONFIG_TEGRA_MMC
 #define CONFIG_CMD_MMC
 
-/* File system support */
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-
 /* USB host support */
 #define CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_TEGRA
diff --git a/include/configs/harmony.h b/include/configs/harmony.h
index 8d1fd47..0c73f86 100644
--- a/include/configs/harmony.h
+++ b/include/configs/harmony.h
@@ -56,14 +56,6 @@
 #define CONFIG_TEGRA_MMC
 #define CONFIG_CMD_MMC
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_FS_EXT4
-#define CONFIG_FS_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-
 /* NAND support */
 #define CONFIG_CMD_NAND
 #define CONFIG_TEGRA_NAND
diff --git a/include/configs/medcom-wide.h b/include/configs/medcom-wide.h
index bae4ba0..57a50d7 100644
--- a/include/configs/medcom-wide.h
+++ b/include/configs/medcom-wide.h
@@ -66,11 +66,6 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-
 #define CONFIG_FIT
 
 #define CONFIG_BOOTCOMMAND \
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
index 2edb4aa..eac1ef9 100644
--- a/include/configs/paz00.h
+++ b/include/configs/paz00.h
@@ -44,14 +44,6 @@
 #define CONFIG_TEGRA_MMC
 #define CONFIG_CMD_MMC
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_FS_EXT4
-#define CONFIG_FS_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_ENV_OFFSET ((1024 * 1024) - CONFIG_ENV_SIZE)
diff --git a/include/configs/plutux.h b/include/configs/plutux.h
index deee237..4cfe88a 100644
--- a/include/configs/plutux.h
+++ b/include/configs/plutux.h
@@ -65,11 +65,6 @@
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-
 #define CONFIG_FIT
 
 #define CONFIG_BOOTCOMMAND \
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index de0c777..f66173e 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -70,14 +70,6 @@
 #define CONFIG_TEGRA_MMC
 #define CONFIG_CMD_MMC
 
-#define CONFIG_DOS_PARTITION
-#define CONFIG_EFI_PARTITION
-#define CONFIG_FS_EXT4
-#define CONFIG_FS_FAT
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
-#define CONFIG_CMD_FS_GENERIC
-
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_ENV_OFFSET ((512 * 1024) - CONFIG_ENV_SIZE)
diff --git a/include/configs/tec.h b/include/configs/tec.h
index caeb9cd..f90f5c7 100644
--- a/include/configs/tec.h
+++ b/include/configs/tec.h
@@ -73

[U-Boot] [PATCH V2 1/4] ARM: tegra: make bounce buffer option common

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

All Tegra devices will need CONFIG_BOUNCE_BUFFER. Move it to
tegra-common.h to ensure it's always set.

Signed-off-by: Stephen Warren 
---
v2: Add missing word to commit subject.

This is based on u-boot-tegra/next, plus my reset vector fix (which
shouldn't conflict), plus Tom's Tegra30 MMC series.

 include/configs/tegra-common.h   |3 +++
 include/configs/tegra20-common.h |3 ---
 include/configs/tegra30-common.h |3 ---
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/configs/tegra-common.h b/include/configs/tegra-common.h
index 4a656bb..a3cb5b9 100644
--- a/include/configs/tegra-common.h
+++ b/include/configs/tegra-common.h
@@ -157,4 +157,7 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_GPIO_SUPPORT
 
+/* Misc utility code */
+#define CONFIG_BOUNCE_BUFFER
+
 #endif /* _TEGRA_COMMON_H_ */
diff --git a/include/configs/tegra20-common.h b/include/configs/tegra20-common.h
index 33e5f52..dac8245 100644
--- a/include/configs/tegra20-common.h
+++ b/include/configs/tegra20-common.h
@@ -114,7 +114,4 @@
 #define CONFIG_SYS_NAND_SELF_INIT
 #define CONFIG_SYS_NAND_ONFI_DETECTION
 
-/* Misc utility code */
-#define CONFIG_BOUNCE_BUFFER
-
 #endif /* _TEGRA20_COMMON_H_ */
diff --git a/include/configs/tegra30-common.h b/include/configs/tegra30-common.h
index bd1dfe8..04517e1 100644
--- a/include/configs/tegra30-common.h
+++ b/include/configs/tegra30-common.h
@@ -86,7 +86,4 @@
 /* Total I2C ports on Tegra30 */
 #define TEGRA_I2C_NUM_CONTROLLERS  5
 
-/* Misc utility code */
-#define CONFIG_BOUNCE_BUFFER
-
 #endif /* _TEGRA30_COMMON_H_ */
-- 
1.7.10.4

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


[U-Boot] [PATCH V2 3/4] disk: define HAVE_BLOCK_DEVICE if CONFIG_CMD_PART

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

Various code that is conditional upon HAVE_BLOCK_DEVICE is required by
code conditional upon CONFIG_CMD_PART. So, enable HAVE_BLOCK_DEVICE if
CONFIG_CMD_PART is enabled.

Signed-off-by: Stephen Warren 
---
v2: New patch
---
 include/config_fallbacks.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index 653ff2b..9298d0e 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -31,6 +31,7 @@
defined(CONFIG_CMD_SATA) || \
defined(CONFIG_CMD_SCSI) || \
defined(CONFIG_CMD_USB) || \
+   defined(CONFIG_CMD_PART) || \
defined(CONFIG_MMC) || \
defined(CONFIG_SYSTEMACE)
 #define HAVE_BLOCK_DEVICE
-- 
1.7.10.4

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


[U-Boot] [PATCH V2 2/4] disk: define HAVE_BLOCK_DEVICE in a common place

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

This set of ifdefs is used in a number of places. Move its definition
somewhere common so it doesn't have to be repeated.

Signed-off-by: Stephen Warren 
---
v2: New patch
---
 disk/part.c|   10 --
 disk/part_amiga.c  |6 +-
 disk/part_dos.c|7 +--
 disk/part_efi.c|8 +---
 disk/part_iso.c|7 +--
 disk/part_mac.c|7 +--
 include/config_fallbacks.h |   10 ++
 7 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index 7bdc90e..1525ed9 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -35,16 +35,6 @@
 #define PRINTF(fmt,args...)
 #endif
 
-/* Rather than repeat this expression each time, add a define for it */
-#if (defined(CONFIG_CMD_IDE) || \
- defined(CONFIG_CMD_SATA) || \
- defined(CONFIG_CMD_SCSI) || \
- defined(CONFIG_CMD_USB) || \
- defined(CONFIG_MMC) || \
- defined(CONFIG_SYSTEMACE) )
-#define HAVE_BLOCK_DEVICE
-#endif
-
 struct block_drvr {
char *name;
block_dev_desc_t* (*get_dev)(int dev);
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index dc7d462..0e6d82d 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -26,11 +26,7 @@
 #include 
 #include "part_amiga.h"
 
-#if defined(CONFIG_CMD_IDE) || \
-defined(CONFIG_CMD_SCSI) || \
-defined(CONFIG_CMD_USB) || \
-defined(CONFIG_MMC) || \
-defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
 
 #undef AMIGA_DEBUG
 
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 3fe901b..37087a6 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -35,12 +35,7 @@
 #include 
 #include "part_dos.h"
 
-#if defined(CONFIG_CMD_IDE) || \
-defined(CONFIG_CMD_SATA) || \
-defined(CONFIG_CMD_SCSI) || \
-defined(CONFIG_CMD_USB) || \
-defined(CONFIG_MMC) || \
-defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
 
 /* Convert char[4] in little endian format to the host format integer
  */
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 7665017..b3fd0e9 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -39,13 +39,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_CMD_IDE) || \
-defined(CONFIG_CMD_SATA) || \
-defined(CONFIG_CMD_SCSI) || \
-defined(CONFIG_CMD_USB) || \
-defined(CONFIG_MMC) || \
-defined(CONFIG_SYSTEMACE)
-
+#ifdef HAVE_BLOCK_DEVICE
 /**
  * efi_crc32() - EFI version of crc32 function
  * @buf: buffer to calculate crc32 of
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 4401790..49639af 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -25,12 +25,7 @@
 #include 
 #include "part_iso.h"
 
-#if defined(CONFIG_CMD_IDE) || \
-defined(CONFIG_CMD_SCSI) || \
-defined(CONFIG_CMD_SATA) || \
-defined(CONFIG_CMD_USB) || \
-defined(CONFIG_MMC) || \
-defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
 
 /* #define ISO_PART_DEBUG */
 
diff --git a/disk/part_mac.c b/disk/part_mac.c
index cb443ac..74dc12f 100644
--- a/disk/part_mac.c
+++ b/disk/part_mac.c
@@ -34,12 +34,7 @@
 #include 
 #include "part_mac.h"
 
-#if defined(CONFIG_CMD_IDE) || \
-defined(CONFIG_CMD_SCSI) || \
-defined(CONFIG_CMD_SATA) || \
-defined(CONFIG_CMD_USB) || \
-defined(CONFIG_MMC) || \
-defined(CONFIG_SYSTEMACE)
+#ifdef HAVE_BLOCK_DEVICE
 
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
 #ifndef __ldiv_t_defined
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index bfb9680..653ff2b 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -26,4 +26,14 @@
 #define CONFIG_EXT4_WRITE
 #endif
 
+/* Rather than repeat this expression each time, add a define for it */
+#if defined(CONFIG_CMD_IDE) || \
+   defined(CONFIG_CMD_SATA) || \
+   defined(CONFIG_CMD_SCSI) || \
+   defined(CONFIG_CMD_USB) || \
+   defined(CONFIG_MMC) || \
+   defined(CONFIG_SYSTEMACE)
+#define HAVE_BLOCK_DEVICE
+#endif
+
 #endif /* __CONFIG_FALLBACKS_H */
-- 
1.7.10.4

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


[U-Boot] [PATCH v2] mx6: Provide a structure for accessing HDMI registers

2013-02-28 Thread Fabio Estevam
From: Fabio Estevam 

Provide a structure for accessing HDMI registers, so that we can use proper
read/write accessors.

Signed-off-by: Fabio Estevam 
Tested-by: Eric Nelson 
---
Changes since v1:
- Add missing 'reserved' arrays
- Add Tested-by

 arch/arm/include/asm/arch-mx6/mxc_hdmi.h  | 1083 +
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |   28 +-
 2 files changed, 558 insertions(+), 553 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h 
b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
index 02a413f..9dccb3f 100644
--- a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
+++ b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
@@ -24,542 +24,553 @@
 /*
  * Hdmi controller registers
  */
-
-/* Identification Registers */
-#define HDMI_DESIGN_ID  0x
-#define HDMI_REVISION_ID0x0001
-#define HDMI_PRODUCT_ID00x0002
-#define HDMI_PRODUCT_ID10x0003
-#define HDMI_CONFIG0_ID 0x0004
-#define HDMI_CONFIG1_ID 0x0005
-#define HDMI_CONFIG2_ID 0x0006
-#define HDMI_CONFIG3_ID 0x0007
-
-/* Interrupt Registers */
-#define HDMI_IH_FC_STAT00x0100
-#define HDMI_IH_FC_STAT10x0101
-#define HDMI_IH_FC_STAT20x0102
-#define HDMI_IH_AS_STAT00x0103
-#define HDMI_IH_PHY_STAT0   0x0104
-#define HDMI_IH_I2CM_STAT0  0x0105
-#define HDMI_IH_CEC_STAT0   0x0106
-#define HDMI_IH_VP_STAT00x0107
-#define HDMI_IH_I2CMPHY_STAT0   0x0108
-#define HDMI_IH_AHBDMAAUD_STAT0 0x0109
-
-#define HDMI_IH_MUTE_FC_STAT0   0x0180
-#define HDMI_IH_MUTE_FC_STAT1   0x0181
-#define HDMI_IH_MUTE_FC_STAT2   0x0182
-#define HDMI_IH_MUTE_AS_STAT0   0x0183
-#define HDMI_IH_MUTE_PHY_STAT0  0x0184
-#define HDMI_IH_MUTE_I2CM_STAT0 0x0185
-#define HDMI_IH_MUTE_CEC_STAT0  0x0186
-#define HDMI_IH_MUTE_VP_STAT0   0x0187
-#define HDMI_IH_MUTE_I2CMPHY_STAT0  0x0188
-#define HDMI_IH_MUTE_AHBDMAAUD_STAT00x0189
-#define HDMI_IH_MUTE0x01FF
-
-/* Video Sample Registers */
-#define HDMI_TX_INVID0  0x0200
-#define HDMI_TX_INSTUFFING  0x0201
-#define HDMI_TX_GYDATA0 0x0202
-#define HDMI_TX_GYDATA1 0x0203
-#define HDMI_TX_RCRDATA00x0204
-#define HDMI_TX_RCRDATA10x0205
-#define HDMI_TX_BCBDATA00x0206
-#define HDMI_TX_BCBDATA10x0207
-
-/* Video Packetizer Registers */
-#define HDMI_VP_STATUS  0x0800
-#define HDMI_VP_PR_CD   0x0801
-#define HDMI_VP_STUFF   0x0802
-#define HDMI_VP_REMAP   0x0803
-#define HDMI_VP_CONF0x0804
-#define HDMI_VP_STAT0x0805
-#define HDMI_VP_INT 0x0806
-#define HDMI_VP_MASK0x0807
-#define HDMI_VP_POL 0x0808
-
-/* Frame Composer Registers */
-#define HDMI_FC_INVIDCONF   0x1000
-#define HDMI_FC_INHACTV00x1001
-#define HDMI_FC_INHACTV10x1002
-#define HDMI_FC_INHBLANK0   0x1003
-#define HDMI_FC_INHBLANK1   0x1004
-#define HDMI_FC_INVACTV00x1005
-#define HDMI_FC_INVACTV10x1006
-#define HDMI_FC_INVBLANK0x1007
-#define HDMI_FC_HSYNCINDELAY0   0x1008
-#define HDMI_FC_HSYNCINDELAY1   0x1009
-#define HDMI_FC_HSYNCINWIDTH0   0x100A
-#define HDMI_FC_HSYNCINWIDTH1   0x100B
-#define HDMI_FC_VSYNCINDELAY0x100C
-#define HDMI_FC_VSYNCINWIDTH0x100D
-#define HDMI_FC_INFREQ0 0x100E
-#define HDMI_FC_INFREQ1 0x100F
-#define HDMI_FC_INFREQ2 0x1010
-#define HDMI_FC_CTRLDUR 0x1011
-#define HDMI_FC_EXCTRLDUR   0x1012
-#define HDMI_FC_EXCTRLSPAC  0x1013
-#define HDMI_FC_CH0PREAM0x1014
-#define HDMI_FC_CH1PREAM0x1015
-#define HDMI_FC_CH2PREAM0x1016
-#define HDMI_FC_AVICONF30x1017
-#define HDMI_FC_GCP 0x1018
-#define HDMI_FC_AVICONF00x1019
-#define HDMI_FC_AVICONF10x101A
-#define HDMI_FC_AVICON

Re: [U-Boot] Please pull u-boot-x86.git

2013-02-28 Thread Simon Glass
Hi Tom,

On Thu, Feb 28, 2013 at 3:00 PM, Tom Rini  wrote:
> On Wed, Feb 27, 2013 at 01:18:23PM -0800, Simon Glass wrote:
>
>> Hi Tom,
>>
>> I have pulled the latest series into a branch in the x86 tree. You can
>> also get it from patchwork. If you are happy with it, please see
>> below. I haven't seen any comments for a few days.
>
> OK, building with ELDK4.2 for a number of ARM boards such as igep0030:
> cmd_mem.c: In function 'do_mem_mtest':
> cmd_mem.c:979: warning: passing argument 1 of 'unmap_sysmem' discards
> qualifiers from pointer target type
> cmd_mem.c:980: warning: passing argument 1 of 'unmap_sysmem' discards
> qualifiers from pointer target type
>

Strange - there is even an explicit cast,. But mine is gcc 4.4.1 so
may be a bit later. I could just remove those two lines since they are
only there for semantic correctness and compile to nothing anyway. But
I will track down that tool chain and see if I can work out a fix.

Regards,
Simon

> Please fix and re-submit, thanks.
>
> --
> Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-x86.git

2013-02-28 Thread Tom Rini
On Wed, Feb 27, 2013 at 01:18:23PM -0800, Simon Glass wrote:

> Hi Tom,
> 
> I have pulled the latest series into a branch in the x86 tree. You can
> also get it from patchwork. If you are happy with it, please see
> below. I haven't seen any comments for a few days.

OK, building with ELDK4.2 for a number of ARM boards such as igep0030:
cmd_mem.c: In function 'do_mem_mtest':
cmd_mem.c:979: warning: passing argument 1 of 'unmap_sysmem' discards
qualifiers from pointer target type
cmd_mem.c:980: warning: passing argument 1 of 'unmap_sysmem' discards
qualifiers from pointer target type

Please fix and re-submit, thanks.

-- 
Tom


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


[U-Boot] [PATCH v2] mxs: spl_mem_init: Align DDR2 init with FSL bootlets source

2013-02-28 Thread Fabio Estevam
From: Fabio Estevam 

Currently the following kernel hang happens when loading a 2.6.35 kernel from
Freeescale on a mx28evk board:

RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Bus freq driver module loaded
IMX usb wakeup probe
usb h1 wakeup device is registered
mxs_cpu_init: cpufreq init finished
...

Loading the same kernel using the bootlets from the imx-bootlets-src-10.12.01 
package, the hang does not occur.

Comparing the DDR2 initialization from the bootlets code against the U-boot 
one, we can notice some mismatches, and after applying the same initialization 
into U-boot the 2.6.35 kernel can boot normally.

Also tested with 'mtest' command, which runs succesfully.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Fix tabs/space confusion and only show the real context changes
 arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c 
b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
index f8392f6..2195dce 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
@@ -45,17 +45,17 @@ static uint32_t dram_vals[] = {
0x, 0x, 0x00010101, 0x01010101,
0x000f0f01, 0x0f02020a, 0x, 0x00010101,
0x0100, 0x0100, 0x, 0x0002,
-   0x0101, 0x05060302, 0x06005003, 0x0ac8,
-   0x02009c40, 0x030c, 0x0036a609, 0x031a0612,
+   0x0101, 0x07080403, 0x06005003, 0x0ac8,
+   0x02009c40, 0x0002030c, 0x0036a609, 0x031a0612,
0x02030202, 0x00c8001c, 0x, 0x,
0x00012100, 0x0303, 0x00012100, 0x0303,
0x00012100, 0x0303, 0x00012100, 0x0303,
0x0003, 0x, 0x, 0x,
0x, 0x, 0x, 0x,
0x, 0x, 0x0612, 0x01000F02,
-   0x06120612, 0x0200, 0x00020007, 0xf5014b27,
-   0xf5014b27, 0xf5014b27, 0xf5014b27, 0x07000300,
-   0x07000300, 0x07000300, 0x07000300, 0x0006,
+   0x06120612, 0x0200, 0x00020007, 0xf4004a27,
+   0xf4004a27, 0xf4004a27, 0xf4004a27, 0x07000300,
+   0x07000300, 0x07400300, 0x07400300, 0x0005,
0x, 0x, 0x0100, 0x01020408,
0x08040201, 0x000f1133, 0x, 0x1f04,
0x1f04, 0x1f04, 0x1f04, 0x1f04,
@@ -76,14 +76,14 @@ static uint32_t dram_vals[] = {
0x, 0x, 0x, 0x,
0x, 0x, 0x, 0x,
0x, 0x, 0x, 0x,
-   0x, 0x, 0x0001, 0x00020304,
-   0x0004, 0x, 0x, 0x,
+   0x, 0x, 0x0001, 0x00030404,
+   0x0003, 0x, 0x, 0x,
0x, 0x, 0x, 0x0101,
0x0100, 0x0303, 0x00010303, 0x01020202,
0x, 0x02040303, 0x21002103, 0x00061200,
-   0x06120612, 0x04320432, 0x04320432, 0x00040004,
+   0x06120612, 0x04420442, 0x04420442, 0x00040004,
0x00040004, 0x, 0x, 0x,
-   0x, 0x00010001
+   0x, 0x
 
 /*
  * i.MX23 DDR at 133MHz
-- 
1.7.9.5

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


[U-Boot] [PATCH 1/2] tools: update checkpatch to latest upstream version

2013-02-28 Thread Kim Phillips
i.e., from the linux kernel's commit
be987d9f80354e2e919926349282facd74992f90

Signed-off-by: Kim Phillips 
---
 tools/checkpatch.pl | 752 ++--
 1 file changed, 558 insertions(+), 194 deletions(-)

diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl
index c7475f9..b28cc38 100755
--- a/tools/checkpatch.pl
+++ b/tools/checkpatch.pl
@@ -33,6 +33,7 @@ my %ignore_type = ();
 my @ignore = ();
 my $help = 0;
 my $configuration_file = ".checkpatch.conf";
+my $max_line_length = 80;
 
 sub help {
my ($exitcode) = @_;
@@ -51,6 +52,7 @@ Options:
   -f, --file treat FILE as regular source file
   --subjective, --strict enable more subjective tests
   --ignore TYPE(,TYPE2...)   ignore various comma separated message types
+  --max-line-length=nset the maximum line length, if exceeded, warn
   --show-types   show the message "types" in the output
   --root=PATHPATH to the kernel tree root
   --no-summary   suppress the per-file summary
@@ -107,6 +109,7 @@ GetOptions(
'strict!'   => \$check,
'ignore=s'  => \@ignore,
'show-types!'   => \$show_types,
+   'max-line-length=i' => \$max_line_length,
'root=s'=> \$root,
'summary!'  => \$summary,
'mailback!' => \$mailback,
@@ -227,8 +230,12 @@ our $Inline= qr{inline|__always_inline|noinline};
 our $Member= qr{->$Ident|\.$Ident|\[[^]]*\]};
 our $Lval  = qr{$Ident(?:$Member)*};
 
-our $Constant  = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*};
-our $Assignment= qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};
+our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
+our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
+our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
+our $Float = qr{$Float_hex|$Float_dec|$Float_int};
+our $Constant  = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*};
+our $Assignment= qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
 our $Compare= qr{<=|>=|==|!=|<|>};
 our $Operators = qr{
<=|>=|==|!=|
@@ -240,9 +247,8 @@ our $NonptrType;
 our $Type;
 our $Declare;
 
-our $UTF8  = qr {
-   [\x09\x0A\x0D\x20-\x7E]  # ASCII
-   | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
+our $NON_ASCII_UTF8= qr{
+   [\xC2-\xDF][\x80-\xBF]   # non-overlong 2-byte
|  \xE0[\xA0-\xBF][\x80-\xBF]# excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
|  \xED[\x80-\x9F][\x80-\xBF]# excluding surrogates
@@ -251,6 +257,11 @@ our $UTF8  = qr {
|  \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
 }x;
 
+our $UTF8  = qr{
+   [\x09\x0A\x0D\x20-\x7E]  # ASCII
+   | $NON_ASCII_UTF8
+}x;
+
 our $typeTypedefs = qr{(?x:
(?:__)?(?:u|s|be|le)(?:8|16|32|64)|
atomic_t
@@ -311,7 +322,7 @@ sub build_types {
$NonptrType = qr{
(?:$Modifier\s+|const\s+)*
(?:
-   (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)|
+   (?:typeof|__typeof__)\s*\([^\)]*\)|
(?:$typeTypedefs\b)|
(?:${all}\b)
)
@@ -319,17 +330,23 @@ sub build_types {
  }x;
$Type   = qr{
$NonptrType
-   (?:[\s\*]+\s*const|[\s\*]+|(?:\s*\[\s*\])+)?
+   
(?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
(?:\s+$Inline|\s+$Modifier)*
  }x;
$Declare= qr{(?:$Storage\s+)?$Type};
 }
 build_types();
 
-our $match_balanced_parentheses = qr/(\((?:[^\(\)]+|(-1))*\))/;
 
 our $Typecast  = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*};
-our $LvalOrFunc= qr{($Lval)\s*($match_balanced_parentheses{0,1})\s*};
+
+# Using $balanced_parens, $LvalOrFunc, or $FuncArg
+# requires at least perl version v5.10.0
+# Any use must be runtime checked with $^V
+
+our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/;
+our $LvalOrFunc= qr{($Lval)\s*($balanced_parens{0,1})\s*};
+our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant)};
 
 sub deparenthesize {
my ($string) = @_;
@@ -342,27 +359,6 @@ sub deparenthesize {
 
 $chk_signoff = 0 if ($file);
 
-my @dep_includes = ();
-my @dep_functions = ();
-my $removal = "Documentation/feature-removal-schedule.txt";
-if ($tree && -f "$root/$removal") {
-   open(my $REMOVE, '<', "$root/$removal") ||
-   die "$P: $removal: open failed - $!\n";
-   while (<$REMOVE>) {
-   if (/^Check:\s+(.*\S)/) {
-   for my $entry (split(/[, ]+/, $1)) {
-   if ($entry =~ m@include/(.*)@) {
-   push(@dep_includes, $1);
-
-  

[U-Boot] [PATCH 2/2] tools: enable more checkpatch tests by default

2013-02-28 Thread Kim Phillips
without this, patches don't get checked for proper alignment,
and e.g., for spaces after a cast and/or before a semicolon.

Signed-off-by: Kim Phillips 
---
 .checkpatch.conf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.checkpatch.conf b/.checkpatch.conf
index 977db9e..38386b3 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -12,3 +12,6 @@
 
 # For min/max
 --ignore MINMAX
+
+# enable more tests
+--strict
-- 
1.8.1.4


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


[U-Boot] [PATCH] ARM: tegra: implement WAR for Tegra114 CPU reset vector

2013-02-28 Thread Stephen Warren
From: Stephen Warren 

A Tegra114 HW bug prevents the main CPU vector from being modified under
certain circumstances. Tegra114 A01P and later with a patched boot ROM
set the CPU reset vector to 0x4003fffc (end of IRAM). This allows placing
an arbitrary jump instruction at that location, in order to redirect to
the desired reset vector location. Modify Tegra114's start_cpu() to make
use of this feature. This allows CPUs with the patched boot ROM to boot.

Based-on-work-by: Jimmy Zhang .
Signed-off-by: Stephen Warren 
---
 arch/arm/cpu/arm720t/tegra114/cpu.c |   36 +++
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/arm720t/tegra114/cpu.c 
b/arch/arm/cpu/arm720t/tegra114/cpu.c
index 5962e15..429ac94 100644
--- a/arch/arm/cpu/arm720t/tegra114/cpu.c
+++ b/arch/arm/cpu/arm720t/tegra114/cpu.c
@@ -269,6 +269,8 @@ void powerup_cpus(void)
 
 void start_cpu(u32 reset_vector)
 {
+   u32 imme, inst;
+
debug("start_cpu entry, reset_vector = %x\n", reset_vector);
 
t114_init_clocks();
@@ -285,12 +287,38 @@ void start_cpu(u32 reset_vector)
/* Take CPU(s) out of reset */
remove_cpu_resets();
 
+   /* Set the entry point for CPU execution from reset */
+
/*
-* Set the entry point for CPU execution from reset,
-*  if it's a non-zero value.
+* A01P with patched boot ROM; vector hard-coded to 0x4003fffc.
+* See nvbug 1193357 for details.
 */
-   if (reset_vector)
-   writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
+
+   /* mov r0, #lsb(reset_vector) */
+   imme = reset_vector & 0x;
+   inst = imme & 0xfff;
+   inst |= ((imme >> 12) << 16);
+   inst |= 0xe300;
+   writel(inst, 0x4003fff0);
+
+   /* movt r0, #msb(reset_vector) */
+   imme = (reset_vector >> 16) & 0x;
+   inst = imme & 0xfff;
+   inst |= ((imme >> 12) << 16);
+   inst |= 0xe340;
+   writel(inst, 0x4003fff4);
+
+   /* bx r0 */
+   writel(0xe12fff10, 0x4003fff8);
+
+   /* b -12 */
+   imme = (u32)-20;
+   inst = (imme >> 2) & 0xff;
+   inst |= 0xea00;
+   writel(inst, 0x4003fffc);
+
+   /* Write to orignal location for compatibility */
+   writel(reset_vector, EXCEP_VECTOR_CPU_RESET_VECTOR);
 
/* If the CPU(s) don't already have power, power 'em up */
powerup_cpus();
-- 
1.7.10.4

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


[U-Boot] [PATCH] mx6: Provide a structure for accessing HDMI registers

2013-02-28 Thread Fabio Estevam
From: Fabio Estevam 

Provide a structure for accessing HDMI registers, so that we can use proper
read/write accessors.

Signed-off-by: Fabio Estevam 
---
Hi Eric,

I have only build-tested, as I don't have a HDMI monitor handy for testing.

 arch/arm/include/asm/arch-mx6/mxc_hdmi.h  | 1084 +
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |   28 +-
 2 files changed, 559 insertions(+), 553 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h 
b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
index 02a413f..0158d0d 100644
--- a/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
+++ b/arch/arm/include/asm/arch-mx6/mxc_hdmi.h
@@ -24,542 +24,554 @@
 /*
  * Hdmi controller registers
  */
-
-/* Identification Registers */
-#define HDMI_DESIGN_ID  0x
-#define HDMI_REVISION_ID0x0001
-#define HDMI_PRODUCT_ID00x0002
-#define HDMI_PRODUCT_ID10x0003
-#define HDMI_CONFIG0_ID 0x0004
-#define HDMI_CONFIG1_ID 0x0005
-#define HDMI_CONFIG2_ID 0x0006
-#define HDMI_CONFIG3_ID 0x0007
-
-/* Interrupt Registers */
-#define HDMI_IH_FC_STAT00x0100
-#define HDMI_IH_FC_STAT10x0101
-#define HDMI_IH_FC_STAT20x0102
-#define HDMI_IH_AS_STAT00x0103
-#define HDMI_IH_PHY_STAT0   0x0104
-#define HDMI_IH_I2CM_STAT0  0x0105
-#define HDMI_IH_CEC_STAT0   0x0106
-#define HDMI_IH_VP_STAT00x0107
-#define HDMI_IH_I2CMPHY_STAT0   0x0108
-#define HDMI_IH_AHBDMAAUD_STAT0 0x0109
-
-#define HDMI_IH_MUTE_FC_STAT0   0x0180
-#define HDMI_IH_MUTE_FC_STAT1   0x0181
-#define HDMI_IH_MUTE_FC_STAT2   0x0182
-#define HDMI_IH_MUTE_AS_STAT0   0x0183
-#define HDMI_IH_MUTE_PHY_STAT0  0x0184
-#define HDMI_IH_MUTE_I2CM_STAT0 0x0185
-#define HDMI_IH_MUTE_CEC_STAT0  0x0186
-#define HDMI_IH_MUTE_VP_STAT0   0x0187
-#define HDMI_IH_MUTE_I2CMPHY_STAT0  0x0188
-#define HDMI_IH_MUTE_AHBDMAAUD_STAT00x0189
-#define HDMI_IH_MUTE0x01FF
-
-/* Video Sample Registers */
-#define HDMI_TX_INVID0  0x0200
-#define HDMI_TX_INSTUFFING  0x0201
-#define HDMI_TX_GYDATA0 0x0202
-#define HDMI_TX_GYDATA1 0x0203
-#define HDMI_TX_RCRDATA00x0204
-#define HDMI_TX_RCRDATA10x0205
-#define HDMI_TX_BCBDATA00x0206
-#define HDMI_TX_BCBDATA10x0207
-
-/* Video Packetizer Registers */
-#define HDMI_VP_STATUS  0x0800
-#define HDMI_VP_PR_CD   0x0801
-#define HDMI_VP_STUFF   0x0802
-#define HDMI_VP_REMAP   0x0803
-#define HDMI_VP_CONF0x0804
-#define HDMI_VP_STAT0x0805
-#define HDMI_VP_INT 0x0806
-#define HDMI_VP_MASK0x0807
-#define HDMI_VP_POL 0x0808
-
-/* Frame Composer Registers */
-#define HDMI_FC_INVIDCONF   0x1000
-#define HDMI_FC_INHACTV00x1001
-#define HDMI_FC_INHACTV10x1002
-#define HDMI_FC_INHBLANK0   0x1003
-#define HDMI_FC_INHBLANK1   0x1004
-#define HDMI_FC_INVACTV00x1005
-#define HDMI_FC_INVACTV10x1006
-#define HDMI_FC_INVBLANK0x1007
-#define HDMI_FC_HSYNCINDELAY0   0x1008
-#define HDMI_FC_HSYNCINDELAY1   0x1009
-#define HDMI_FC_HSYNCINWIDTH0   0x100A
-#define HDMI_FC_HSYNCINWIDTH1   0x100B
-#define HDMI_FC_VSYNCINDELAY0x100C
-#define HDMI_FC_VSYNCINWIDTH0x100D
-#define HDMI_FC_INFREQ0 0x100E
-#define HDMI_FC_INFREQ1 0x100F
-#define HDMI_FC_INFREQ2 0x1010
-#define HDMI_FC_CTRLDUR 0x1011
-#define HDMI_FC_EXCTRLDUR   0x1012
-#define HDMI_FC_EXCTRLSPAC  0x1013
-#define HDMI_FC_CH0PREAM0x1014
-#define HDMI_FC_CH1PREAM0x1015
-#define HDMI_FC_CH2PREAM0x1016
-#define HDMI_FC_AVICONF30x1017
-#define HDMI_FC_GCP 0x1018
-#define HDMI_FC_AVICONF00x1019
-#define HDMI_FC_AVICONF10x101A
-#define HDMI_FC_AVICONF2  

Re: [U-Boot] [PATCH v4 0/11] Add BF60x processor support to Blackfin architecture.

2013-02-28 Thread Tom Rini
On Thu, Feb 21, 2013 at 07:06:38PM +0800, Sonic Zhang wrote:

> From: Sonic Zhang 
> 
> 
> ADSP-BF60x is the new generation Blackfin?? dual-core processor announced by
> Analog Devices in late March, 2012. This patch set adds BF60x processor 
> support
> to Das U-Boot Blackfin architecture.
> 
> For more information, see http://blackfin.uclinux.org .
> 
> Changes in v4:
> - Remove last blank line in initcode.c.
> - Fix all checkpatch issues except for cpu name bf609-0.0. It is use as the
> link flags and is not an error.
> - Remove the values for variables in bf609 config headers whose values are 
> useless.
> - Fix checkpatch warning whitespace before semicolon

This all looks fine.  If no one else comments soon, feel free to make up
your first pull request.

-- 
Tom


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


Re: [U-Boot] [PATCH V2 2/6] i.MX6: consolidate pad names for multi-CPU boards

2013-02-28 Thread Eric Nelson

On 02/28/2013 01:26 PM, Fabio Estevam wrote:

Hi Eric,

On Sat, Feb 23, 2013 at 1:31 PM, Eric Nelson
 wrote:


It's probably going to be a week or so before I can re-work the
HDMI detection code per Wolfgang's request and re-submit Nitrogen6X.


I work on a patch that will add an hdmi structure, so that we can
remove the base + offset register access.

Will send it later today.



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


Re: [U-Boot] [PATCH v2] dts/Makefile: Build the user specified dts

2013-02-28 Thread Simon Glass
On Thu, Feb 28, 2013 at 12:20 PM, Jagannadha Sutradharudu Teki
 wrote:
> This patch provides a support to build the user specified dts.
>
> Signed-off-by: Jagannadha Sutradharudu Teki 

Acked-by: Simon Glass 

Thank you.

> ---
> Changes for v2:
> - Update the logic for not giving an error if DEVICE_TREE defined
> - Documented the build steps
>  doc/README.fdt-control |8 
>  dts/Makefile   |2 ++
>  2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/doc/README.fdt-control b/doc/README.fdt-control
> index 85bda03..8352835 100644
> --- a/doc/README.fdt-control
> +++ b/doc/README.fdt-control
> @@ -156,6 +156,14 @@ To use this, put something like this in your board 
> header file:
>
>  #define CONFIG_EXTRA_ENV_SETTINGS  "fdtcontroladdr=1\0"
>
> +Build:
> +
> +After board configuration is done, fdt supported u-boot can be build in two 
> ways:
> +1)  build the default dts which is defined from CONFIG_DEFAULT_DEVICE_TREE
> +$ make
> +2)  build the user specified dts file
> +$ make DEVICE_TREE=
> +
>
>  Limitations
>  ---
> diff --git a/dts/Makefile b/dts/Makefile
> index 785104e..01364d7 100644
> --- a/dts/Makefile
> +++ b/dts/Makefile
> @@ -27,9 +27,11 @@ include $(TOPDIR)/config.mk
>
>  LIB= $(obj)libdts.o
>
> +ifeq ($(DEVICE_TREE),)
>  $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
>  $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file))
>  DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
> +endif
>
>  $(if $(CONFIG_ARCH_DEVICE_TREE),,\
>  $(error Your architecture does not have device tree support enabled. \
> --
> 1.7.4
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] FDT howto

2013-02-28 Thread Jagan Teki
Hi Simon,

On Thu, Feb 28, 2013 at 7:22 PM, Simon Glass  wrote:
> Hi Jagan,
>
> On Thu, Feb 28, 2013 at 3:14 AM, Jagan Teki  wrote:
>> Hi Simon,
>>
>> On Mon, Feb 25, 2013 at 4:40 AM, Simon Glass  wrote:
>>> Hi Jagan,
>>>
>>> On Sun, Feb 24, 2013 at 10:58 AM, Jagan Teki  
>>> wrote:
 Hi Simon,

 On Sun, Feb 24, 2013 at 11:55 PM, Jagan Teki  
 wrote:
> Hi Simon,
>
> On Sun, Feb 24, 2013 at 11:50 PM, Simon Glass  wrote:
>> Hi,
>>
>> On Sun, Feb 24, 2013 at 9:55 AM, Jagan Teki  
>> wrote:
>>> Hi Simon,
>>>
>>> On Sun, Feb 24, 2013 at 11:18 PM, Simon Glass  wrote:
 Hi Jegan,

 On Sun, Feb 24, 2013 at 9:45 AM, Jagan Teki  
 wrote:
> Hi Simon,
>
> On Sun, Feb 24, 2013 at 11:08 PM, Simon Glass  
> wrote:
>> Hi Jagan,
>>
>> On Sun, Feb 24, 2013 at 8:19 AM, Jagan Teki 
>>  wrote:
>>> Hi Simon,
>>>
>>> Thanks for your response, please find my below comments.
>>>
>>> On Sun, Feb 24, 2013 at 9:24 PM, Simon Glass  
>>> wrote:
 Hi Jagan,

 On Thu, Feb 21, 2013 at 9:03 AM, Jagan Teki 
  wrote:
> Hi All,
>
> I am planning to use devicetree on u-boot.
> I have an experience to work with devicetree on Linux.
>
> For u-boot, I have read doc from doc/README.fdt-control.
> I see some dts usages on tegra boards.
>
> I have lot of confusions with the concept itself.
>
> Is Linux and u-boot devicetree concept and build system are same?

 I don't really understand this question sorry. U-Boot and Linux use
 the device tree mainly for run-time configuration of drivers, so 
 that
 the same driver code can operate on different boards.
>>>
>>> I am some how confusing the fdt usage in u-boot.
>>> Because when compared to Linux, u-boot fdt setup mandatory to 
>>> require
>>> the CONFIG_DEFAULT_DEVICE_TREE
>>> on the config file [from your previous comments].
>>>
>>> is this the only difference when compared to Linux i guess..is it?
>>> Linux defconfig file does need to hot-code
>>> the dts.
>>
>> Yes - that is a difference. Linux provides a way to build .dts files
>> but it is not mandatory. At present it is mandatory with U-Boot, and
>> only one file is built. It can easily be ignored though.
>
> Ok.
>
>>
>>>

>
> Suppose I have 4 boards J1, J2, J3 & J4 on my soc "emb".of vendor 
> "vast"
>For this requirement I have
>board/vast/dts/J1.dts
>board/vast/dts/J2.dts
>board/vast/dts/J3.dts
>board/vast/dts/J4.dts
>
>include/configs/emb_common.h ==> single configuration of all 
> SOC
> needed definitions
>like defconfig in Linux.
>
>do I need any more files?

 That's enough for the basics I think.
>>>
>>> Is dtsi file require to add it on arch folder along with above.
>>
>> If your architecture is not one of those already supported (like arm
>> tegra/exynos and x86) then yes you need to add this file in
>> arch//dts. What architecture are you using?
>
> My architecture is armv7, may be for me dtsi not required as arm is
> existing architecture
> to support fdt on u-boot.. is it?

 Which sub-arch? If it is tegra/exynos5250 then you might be OK. For
 something else, you should get the kernel's .dtsi file for that chip.
>>>
>>> I am having armv7, xilinx zynq soc..but i coun't get any .dtsi on 
>>> kernel source.
>>> may be I will create new one.
>>
>> OK, well if the kernel doesn't have FDT support yet then yes you will
>> need to create a new one.
>>
>>>

>
>>
>>>

>
>In emb_common.h i am defining
>CONFIG_OF_SEPARATE is it sufficient?

 And CONFIG_OF_CONTROL

>
>My plan is to build u-boot and then build the dtb with specific
> board and then combine.

 That's fine, and is how we do things on Chromium also. U-Boot 
 tries to
 build an FDT even with CONFIG_OF_SEPARATE, so you need to put a
 default device tree file in your emb_common.h file that it can 
 find.
 But you can ignore it, and for flashing your boards just use
 u-boot.bi

Re: [U-Boot] [PATCH V2 2/6] i.MX6: consolidate pad names for multi-CPU boards

2013-02-28 Thread Fabio Estevam
Hi Eric,

On Sat, Feb 23, 2013 at 1:31 PM, Eric Nelson
 wrote:

> It's probably going to be a week or so before I can re-work the
> HDMI detection code per Wolfgang's request and re-submit Nitrogen6X.

I work on a patch that will add an hdmi structure, so that we can
remove the base + offset register access.

Will send it later today.

Regards,

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


Re: [U-Boot] Pull request: nand flash

2013-02-28 Thread Tom Rini
On Tue, Feb 26, 2013 at 03:44:22PM -0600, Scott Wood wrote:

> The following changes since commit 47104c37de076e2be35ae1b3d144614f4d24a766:
> 
>   MAKEALL: add support for per architecture toolchains (2013-02-20 09:40:34 
> -0500)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-nand-flash.git master
> 
> for you to fetch changes up to a1eac57a2001ecf86a46f520cd85ef8e9c8b3687:
> 
>   common/env_nand.c: calculate crc only when readenv was OK (2013-02-22 
> 19:59:53 -0600)
> 
> 
> Harvey Chapman (1):
>   nand: fix nand read.option parsing
> 
> Joe Hershberger (1):
>   mtd: nand: Check if NAND is locked tight before lock cmds
> 
> Phil Sutter (2):
>   env_nand.c: clarify log messages when env reading fails
>   common/env_nand.c: calculate crc only when readenv was OK
> 
> Vipin Kumar (1):
>   imls: Add support to list images in NAND device
> 
>  README   |3 +-
>  common/cmd_bootm.c   |  167 
> +-
>  common/cmd_nand.c|2 +-
>  common/env_nand.c|   18 +++--
>  drivers/mtd/nand/nand_util.c |   19 -
>  5 files changed, 197 insertions(+), 12 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH v2] dts/Makefile: Build the user specified dts

2013-02-28 Thread Jagannadha Sutradharudu Teki
This patch provides a support to build the user specified dts.

Signed-off-by: Jagannadha Sutradharudu Teki 
---
Changes for v2:
- Update the logic for not giving an error if DEVICE_TREE defined
- Documented the build steps 
 doc/README.fdt-control |8 
 dts/Makefile   |2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/doc/README.fdt-control b/doc/README.fdt-control
index 85bda03..8352835 100644
--- a/doc/README.fdt-control
+++ b/doc/README.fdt-control
@@ -156,6 +156,14 @@ To use this, put something like this in your board header 
file:
 
 #define CONFIG_EXTRA_ENV_SETTINGS  "fdtcontroladdr=1\0"
 
+Build:
+
+After board configuration is done, fdt supported u-boot can be build in two 
ways:
+1)  build the default dts which is defined from CONFIG_DEFAULT_DEVICE_TREE
+$ make
+2)  build the user specified dts file
+$ make DEVICE_TREE=
+
 
 Limitations
 ---
diff --git a/dts/Makefile b/dts/Makefile
index 785104e..01364d7 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -27,9 +27,11 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)libdts.o
 
+ifeq ($(DEVICE_TREE),)
 $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
 $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file))
 DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
+endif
 
 $(if $(CONFIG_ARCH_DEVICE_TREE),,\
 $(error Your architecture does not have device tree support enabled. \
-- 
1.7.4


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


Re: [U-Boot] AM335x PLL configuration

2013-02-28 Thread Tom Rini
On Sat, Feb 23, 2013 at 11:45:45AM +, Mark Jackson wrote:

> All the current TI AM335x boards currently appear to start with an MPU clock 
> of 550MHx and a core clock of 1GHz,
> based on #defines in include/asm/arch-am33xx/clocks_am33xx.h
> 
> I assume most people then pass control over to (eg) cpufreq once Linux boots.
> 
> However I would like to just boot up at the max clock speed (i.e. 720MHz).
> 
> Is there any merit in reworking this to allow the clock speeds to be 
> specified in the config heaeder file ?
> 
> Or would it be better to allow the board init code to adjust the clock 
> settings "on-the-fly" ?
> 
> I could just add some extra code to my own board.c file, but that doesn't 
> seem like a very elegant solution !!
> 
> Maybe someone else already has a solution for this ?

The "vendor" tree has a partial solution for this, which is to make the
initial speed be the safe value (550MHz) and then if we can, depending
on board, run the clock up.  For example, Beaglebone can be USB bus
powered or wall-powered, but it's only safe to run up to 720MHz (due to
potenital power spikes later on during kernel boot) if on wall power.

So yes, if you want to start down the road of allowing boards to say "I
know I can now run at ...", please do so!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/4] Exynos: Add hardware accelerated SHA 256

2013-02-28 Thread Kim Phillips
On Thu, 28 Feb 2013 11:08:21 +
Akshay Saraswat  wrote:

> >On Wed, 27 Feb 2013 10:24:39 -0500
> 
> >Akshay Saraswat  wrote:

can you fix your mailer to not double space lines?

> >> +/* Maximum input data size is 8 MB. Timeout observed for data size above 
> >> 8MB */
> >> +#define TIMEOUT_MS  100
> 
> >So if there's a drop in processor frequency, the driver times out
> >too early?  Not good.
> 
> Right now we dont have any way to calculate the timeout.

not even empirically?

> So, I have incremented this value
> to 500 which shall be good enough for the lowest of all frequencies. But I 
> guess what we
> need here is some formula, to calculate timeout on the basis of frequency, 
> which is nowhere
> defined.

That's odd - I see a bunch of frequencies advertised in
arch/arm/cpu/armv7/exynos/clock.c.

Or how about using a cycle counter instead?

btw, where can I find documentation for the ACE?

Kim

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


Re: [U-Boot] [PATCH 1/3 v2] Exynos: Add hardware accelerated SHA 256

2013-02-28 Thread Kim Phillips
On Thu, 28 Feb 2013 06:00:21 -0500
Akshay Saraswat  wrote:

> ---
> Changes since v1:
>   - Moved code to drivers/crypto.
>   - Fixed few other nits.

be more specific wrt changes between revisions.

> + if (buf_len == 0) {
> + /* ACE H/W cannot compute hash value for empty string */
> + if (hash_type == ACE_SHA_TYPE_SHA1)
> + memcpy(pout, sha1_digest_emptymsg, SHA1_SUM_LEN);
> + else
> + memcpy(pout, sha256_digest_emptymsg, SHA256_SUM_LEN);
> + return 0;
> + } else if (buf_len > BUF_LIMIT) {
> + debug("%s: Buffer length beyond limit\n", __func__);
> + return -1;
> + }

erroring out just because the user asked for a hash on something
larger than 8MB is unacceptable:  any hash implementation that
replaces a corresponding software implementation must not
introduce new limitations and regressions.

If the hardware supports hash updating - which is likely - use
that to perform hashes >8MB.  If not, revert to software. And for
the 0 length case.

> + start = get_timer(0);
> +
> + while ((readl(&ace_sha_reg->hash_status) & ACE_HASH_MSGDONE_MASK) ==
> + ACE_HASH_MSGDONE_OFF) {

alignment - the 'A' in ACE_H*_OFF should fall directly below
the '(' in 'readl('.

> + if (get_timer(start) > TIMEOUT_MS) {
> + debug("%s: Timeout waiting for ACE\n", __func__);

see my other email to v1 of this patch wrt timing-out.

> + len = (hash_type == ACE_SHA_TYPE_SHA1) ? SHA1_SUM_LEN / 4
> + : SHA256_SUM_LEN / 4;

alignment

a more recent version of checkpatch finds other such problems:

CHECK: No space is necessary after a cast
#610: FILE: drivers/crypto/ace_sha.c:52:
+   struct exynos_ace_sfr *ace_sha_reg =
+   (struct exynos_ace_sfr *) samsung_get_base_ace_sfr();

CHECK: Alignment should match open parenthesis
#630: FILE: drivers/crypto/ace_sha.c:72:
+   writel(ACE_HASH_SWAPDI_ON | ACE_HASH_SWAPDO_ON | ACE_HASH_SWAPIV_ON,
+   &ace_sha_reg->hash_byteswap);

CHECK: Blank lines aren't necessary after an open brace '{'
#658: FILE: drivers/crypto/ace_sha.c:100:
+   ACE_HASH_MSGDONE_OFF) {
+

CHECK: space prohibited before semicolon
#673: FILE: drivers/crypto/ace_sha.c:115:
+   for (i = 0; i < len ; i++)

Kim

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


Re: [U-Boot] [PATCH v2] tpm: Add TPM command library

2013-02-28 Thread Che-liang Chiou
Hi Reinhard,

Replied below.

On Thu, Feb 28, 2013 at 6:50 AM, Pfau, Reinhard  wrote:
>
> Hi,
>
> While digging through the code, some question arises.
> So let me drop some notes about the patch:
>
> ( I apologize for some weird word wraps in the quoted text, but I have
> to use
> a well known UMA which seems to be too stupid to keep lines of text
> without additional
> word wraps...)
>
>> -Original Message-
>> From: u-boot-boun...@lists.denx.de
>> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Che-Liang Chiou
>> Sent: Friday, February 15, 2013 12:01 AM
>> To: u-boot@lists.denx.de
>> Subject: [U-Boot] [PATCH v2] tpm: Add TPM command library
>>
>> TPM command library implements a subset of TPM commands defined in TCG
>> Main Specification 1.2 that are useful for implementing secure boot.
>> More TPM commands could be added out of necessity.
>>
>> You may exercise these commands through the 'tpm' command.
>> However, the
>> raw TPM commands are too primitive for writing secure boot in command
>> interpreter scripts; so the 'tpm' command also provides
>> helper functions
>> to make scripting easier.
>>
>> For example, to define a counter in TPM non-volatile storage and
>> initialize it to zero:
>>
>> $ tpm init
>> $ tpm startup TPM_ST_CLEAR
>> $ tpm nv_define d 0x1001 0x1
>> $ tpm nv_write d 0x1001 0
>>
>> And then increment the counter by one:
>>
>> $ tpm nv_read d 0x1001 i
>> $ setexpr.l i $i + 1
>> $ tpm nv_write d 0x1001 $i
>>
>> Signed-off-by: Che-Liang Chiou 
>> ---
>>  common/cmd_tpm.c | 709
>> +++
>>  include/{tpm.h => tis.h} |   8 +-
>>  include/tpm.h| 197 ++---
>>  lib/Makefile |   1 +
>>  lib/tpm.c| 569 +
>>  5 files changed, 1339 insertions(+), 145 deletions(-)
>>  copy include/{tpm.h => tis.h} (95%)
>>  create mode 100644 lib/tpm.c
>>
> [snip]
>> diff --git a/lib/tpm.c b/lib/tpm.c
>> new file mode 100644
>> index 000..7d13951
>> --- /dev/null
>> +++ b/lib/tpm.c
> [snip]
>> +/**
>> + * Send a TPM command and return response's return code.
>> + *
>> + * @param commandbyte string of TPM command
>> + * @return return code of the TPM response
>> + */
>> +static uint32_t tpm_send_command(const void *command)
>> +{
>> + uint8_t response[COMMAND_BUFFER_SIZE];
>> + size_t response_length = sizeof(response);
>> + uint32_t err;
>> +
>> + err = tis_sendrecv(command, tpm_command_size(command),
>> + response, &response_length);
>> + if (err)
>> + return err;
>> +
>> + return tpm_return_code(response);
>> +}
>
> Using the result of tis_sendrecv would be OK with the I2C-TPM patch
> posted on this ML about a year ago.
> The implementation of tis_sendrecv in generic_lpc_tpm.c returns the
> value (1) on error instead of -1
> (as documented in the header file). Since 1 is a well defined TPM result
> code (TPM_AUTHFAIL) this could
> result in some problems.
> (But I think, this is a bug in the current generic_lpc_tpm driver...)
>
> [snip]
>

I agree it is a bug in the current generic_lpc_tpm driver. And here
tpm_send_command() should return TPM_LIB_ERROR (which is a
distinguishable value from well-defined TPM result codes) in case of
tis_sendrecv() returning non-zero value.

>> +
>> +uint32_t tpm_nv_read_value(uint32_t index, void *data,
>> uint32_t count)
>> +{
>> + const uint8_t command[22] = {
>> + 0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0xcf,
>> + };
>> + const size_t index_offset = 10;
>> + const size_t length_offset = 18;
>> + const size_t data_size_offset = 10;
>> + const size_t data_offset = 14;
>> + uint8_t buf[COMMAND_BUFFER_SIZE], response[COMMAND_BUFFER_SIZE];
>> + uint32_t response_length = sizeof(response), data_size;
>> + uint32_t err;
>> +
>> + if (pack_byte_string(buf, sizeof(buf), "sdd",
>> + 0, command, sizeof(command),
>> + index_offset, index,
>> + length_offset, count))
>> + return TPM_LIB_ERROR;
>> + err = tis_sendrecv(buf, tpm_command_size(buf),
>> + response, &response_length);
>> + if (err)
>> + return err;
>
> At this point we should add something like:
>
> err = tpm_return_code(response);
> if (err)
> return err;
>
> to return the "real" result code from the TPM in case of an error.
> Else the following code will map all TPM errors to TPM_LIB_ERROR
> (since unpack_byte_string will fail).
>
> Same in the other funcs which interpret the result of the command
> (tpm_extend, tpm_pcr_read, rtpm_read_pubek, tpm_get_capability).
>

Done.

>> + if (unpack_byte_string(response, response_length, "d",
>> + data_size_offset, &data_size))
>> + return TPM_LIB_ERROR;
>> + if (data_size > count)
>> + return TPM_LIB

[U-Boot] imx28 secure boot

2013-02-28 Thread Ruud Commandeur
Hi everyone,

This issue is more imx28 / ltib related, but here it goes:

If I build the u-boot from the ltib package and want to flash an SD-card
with the boot stream, I have the choice between imx28_uboot.sb and
imx28_ivt_uboot.sd (a HAB secured one). For the mx28evk, it only works
if I use the _ivt_ one, since HAB is per default enabled.

But now I take the mainline (u-boot-imx.git). The only bootstream output
is the uboot.sb, which is (I assume) not secured. So I tried to add this
code security without success, but then it appears that this bootstream
just works on the mx28evk.

This is not a real problem if things work, but can anyone explain to me
how this works?

Best regards,

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


Re: [U-Boot] [PATCH v2] tpm: Add TPM command library

2013-02-28 Thread Pfau, Reinhard

Hi,

While digging through the code, some question arises.
So let me drop some notes about the patch:

( I apologize for some weird word wraps in the quoted text, but I have
to use
a well known UMA which seems to be too stupid to keep lines of text
without additional
word wraps...)

> -Original Message-
> From: u-boot-boun...@lists.denx.de 
> [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Che-Liang Chiou
> Sent: Friday, February 15, 2013 12:01 AM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH v2] tpm: Add TPM command library
> 
> TPM command library implements a subset of TPM commands defined in TCG
> Main Specification 1.2 that are useful for implementing secure boot.
> More TPM commands could be added out of necessity.
> 
> You may exercise these commands through the 'tpm' command.  
> However, the
> raw TPM commands are too primitive for writing secure boot in command
> interpreter scripts; so the 'tpm' command also provides 
> helper functions
> to make scripting easier.
> 
> For example, to define a counter in TPM non-volatile storage and
> initialize it to zero:
> 
> $ tpm init
> $ tpm startup TPM_ST_CLEAR
> $ tpm nv_define d 0x1001 0x1
> $ tpm nv_write d 0x1001 0
> 
> And then increment the counter by one:
> 
> $ tpm nv_read d 0x1001 i
> $ setexpr.l i $i + 1
> $ tpm nv_write d 0x1001 $i
> 
> Signed-off-by: Che-Liang Chiou 
> ---
>  common/cmd_tpm.c | 709 
> +++
>  include/{tpm.h => tis.h} |   8 +-
>  include/tpm.h| 197 ++---
>  lib/Makefile |   1 +
>  lib/tpm.c| 569 +
>  5 files changed, 1339 insertions(+), 145 deletions(-)
>  copy include/{tpm.h => tis.h} (95%)
>  create mode 100644 lib/tpm.c
>
[snip] 
> diff --git a/lib/tpm.c b/lib/tpm.c
> new file mode 100644
> index 000..7d13951
> --- /dev/null
> +++ b/lib/tpm.c
[snip]
> +/**
> + * Send a TPM command and return response's return code.
> + *
> + * @param commandbyte string of TPM command
> + * @return return code of the TPM response
> + */
> +static uint32_t tpm_send_command(const void *command)
> +{
> + uint8_t response[COMMAND_BUFFER_SIZE];
> + size_t response_length = sizeof(response);
> + uint32_t err;
> +
> + err = tis_sendrecv(command, tpm_command_size(command),
> + response, &response_length);
> + if (err)
> + return err;
> +
> + return tpm_return_code(response);
> +}

Using the result of tis_sendrecv would be OK with the I2C-TPM patch
posted on this ML about a year ago.
The implementation of tis_sendrecv in generic_lpc_tpm.c returns the
value (1) on error instead of -1
(as documented in the header file). Since 1 is a well defined TPM result
code (TPM_AUTHFAIL) this could
result in some problems.
(But I think, this is a bug in the current generic_lpc_tpm driver...)

[snip]

> +
> +uint32_t tpm_nv_read_value(uint32_t index, void *data, 
> uint32_t count)
> +{
> + const uint8_t command[22] = {
> + 0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0xcf,
> + };
> + const size_t index_offset = 10;
> + const size_t length_offset = 18;
> + const size_t data_size_offset = 10;
> + const size_t data_offset = 14;
> + uint8_t buf[COMMAND_BUFFER_SIZE], response[COMMAND_BUFFER_SIZE];
> + uint32_t response_length = sizeof(response), data_size;
> + uint32_t err;
> +
> + if (pack_byte_string(buf, sizeof(buf), "sdd",
> + 0, command, sizeof(command),
> + index_offset, index,
> + length_offset, count))
> + return TPM_LIB_ERROR;
> + err = tis_sendrecv(buf, tpm_command_size(buf),
> + response, &response_length);
> + if (err)
> + return err;

At this point we should add something like:

err = tpm_return_code(response);
if (err)
return err;

to return the "real" result code from the TPM in case of an error.
Else the following code will map all TPM errors to TPM_LIB_ERROR
(since unpack_byte_string will fail).

Same in the other funcs which interpret the result of the command
(tpm_extend, tpm_pcr_read, rtpm_read_pubek, tpm_get_capability).

> + if (unpack_byte_string(response, response_length, "d",
> + data_size_offset, &data_size))
> + return TPM_LIB_ERROR;
> + if (data_size > count)
> + return TPM_LIB_ERROR;
> + if (unpack_byte_string(response, response_length, "s",
> + data_offset, data, data_size))
> + return TPM_LIB_ERROR;
> +
> + return 0;
> +}
> +
> +uint32_t tpm_nv_write_value(uint32_t index, const void 
> *data, uint32_t length)
> +{
> + const uint8_t command[256] = {
> + 0x0, 0xc1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd,
> + };
> + const size_t command_size_offset = 2;
> + const size_t index_

[U-Boot] Beagleboard: SPL hangs on serial init

2013-02-28 Thread man . huber
SPL hangs on a beagleboard during the serial initialization (line 40 of 
drivers/serial/ns16550.c). The reason is the non-empty shift register of TX 
(transmit FIFO is empty). To avoid the hangup include/configs/omap3_beagle.h 
has to be changed like in include/configs/igep00x0.h:

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 59255c4..63cd30b 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -81,6 +81,9 @@
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
 
+/* define to avoid U-Boot to hang while waiting for TEMT */
+#define CONFIG_SYS_NS16550_BROKEN_TEMT
+
 /*
  * select serial console configuration
  */

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


Re: [U-Boot] problem to boot i.MX28 custom platform

2013-02-28 Thread Hector Palacios

On 02/26/2013 01:19 PM, Hector Palacios wrote:

Greetings,

I'm porting a custom platform based on mx28evk to latest U-Boot.
I modified the iomux.c for my platform (different DUART pins) and made some 
changes to
mxs_adjust_memory_params() to accommodate to my DRAM chip.

I built the u-boot.sb. The platform however does not boot either from USB or 
from MMC.
When loaded through USB, sb_loader complains with the messages at [1].
I fear the CPU resets before even executing the SPL code, but how could I tell? 
Is
there a way to check if the CPU reaches this code at all?
I don't see any ROM error codes either and the CPU seems to reset (when the USB
recovery mode fails, the target defaults to boot from flash my old v2009 
U-Boot).
Is there any other init stuff (linker scripts or something) I should take care 
of
that's preventing sb_loader to fully load the image?

Thank you.


[1] sb_loader output

'Freescale,Inc.' 'ROM Recovery' device at USB path 0002:0034:00
Downloading 415504 bytes...
hid_write report id 01 len 0x1f

hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
.
hid_write report id 02 len 0x400
ERROR: hid_write() returned -1 (error (null))



Apparently the problem was due to my platform suffering a hardware specific VDDD 
brownout during the initialization.


Just in case it helps anybody, the reason why I was not able to see anything on the 
DUART port during SPL initialization, despite having enabled CONFIG_SPL_SERIAL_SUPPORT 
and having serial_puts() on the SPL code, was that my platform uses alternate pins for 
the DUART than the default used by the BOOT ROM and the EVK, so apart from configuring 
the correct IOMUX, I needed to unconfigure the pins used by BOOT ROM for the DUART (on 
board//iomux.c):


@@ -33,8 +33,12 @@

 const iomux_cfg_t iomux_setup[] = {
/* DUART */
-   MX28_PAD_PWM0__DUART_RX,
-   MX28_PAD_PWM1__DUART_TX,
+   /* Unconfigure BOOT ROM default DUART */
+   MX28_PAD_PWM0__GPIO_3_16,
+   MX28_PAD_PWM1__GPIO_3_17,
+   /* Configure DUART on alternate pins */
+   MX28_PAD_I2C0_SCL__DUART_RX,
+   MX28_PAD_I2C0_SDA__DUART_TX,

/* MMC0 */
MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
@@ -159,9 +163,6 @@ const iomux_cfg_t iomux_setup[] = {
MX28_PAD_SSP2_MISO__SSP2_D0 | MUX_CONFIG_SSP2,
MX28_PAD_SSP2_SS0__SSP2_D3 |
(MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
-   /* I2C */
-   MX28_PAD_I2C0_SCL__I2C0_SCL,
-   MX28_PAD_I2C0_SDA__I2C0_SDA,
 };

 #define HW_DRAM_CTL29  (0x74 >> 2)

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


[U-Boot] [PATCH v3] tpm: Add TPM command library

2013-02-28 Thread Che-Liang Chiou
TPM command library implements a subset of TPM commands defined in TCG
Main Specification 1.2 that are useful for implementing secure boot.
More TPM commands could be added out of necessity.

You may exercise these commands through the 'tpm' command.  However, the
raw TPM commands are too primitive for writing secure boot in command
interpreter scripts; so the 'tpm' command also provides helper functions
to make scripting easier.

For example, to define a counter in TPM non-volatile storage and
initialize it to zero:

$ tpm init
$ tpm startup TPM_ST_CLEAR
$ tpm nv_define d 0x1001 0x1
$ tpm nv_write d 0x1001 0

And then increment the counter by one:

$ tpm nv_read d 0x1001 i
$ setexpr.l i $i + 1
$ tpm nv_write d 0x1001 $i

Signed-off-by: Che-Liang Chiou 
---
Changes in v3:
- Add check of TPM response code

Changes in v2:
- Merge tpm_util into tpm

 common/cmd_tpm.c | 709 +++
 include/{tpm.h => tis.h} |   8 +-
 include/tpm.h| 197 ++---
 lib/Makefile |   1 +
 lib/tpm.c| 581 ++
 5 files changed, 1351 insertions(+), 145 deletions(-)
 copy include/{tpm.h => tis.h} (95%)
 create mode 100644 lib/tpm.c

diff --git a/common/cmd_tpm.c b/common/cmd_tpm.c
index 0970a6f..46fae18 100644
--- a/common/cmd_tpm.c
+++ b/common/cmd_tpm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (c) 2013 The Chromium OS Authors.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,163 +22,652 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
-#define MAX_TRANSACTION_SIZE 30
+/**
+ * Print a byte string in hexdecimal format, 16-bytes per line.
+ *
+ * @param data byte string to be printed
+ * @param countnumber of bytes to be printed
+ */
+static void print_byte_string(uint8_t *data, size_t count)
+{
+   int i, print_newline = 0;
 
-/*
- * tpm_write() expects a variable number of parameters: the internal address
- * followed by data to write, byte by byte.
+   for (i = 0; i < count; i++) {
+   printf(" %02x", data[i]);
+   print_newline = (i % 16 == 15);
+   if (print_newline)
+   putc('\n');
+   }
+   /* Avoid duplicated newline at the end */
+   if (!print_newline)
+   putc('\n');
+}
+
+/**
+ * Convert a text string of hexdecimal values into a byte string.
  *
- * Returns 0 on success or -1 on errors (wrong arguments or TPM failure).
+ * @param bytestext string of hexdecimal values with no space
+ * between them
+ * @param data output buffer for byte string.  The caller has to make
+ * sure it is large enough for storing the output.  If
+ * NULL is passed, a large enough buffer will be allocated,
+ * and the caller must free it.
+ * @param count_ptroutput variable for the length of byte string
+ * @return pointer to output buffer
  */
-static int tpm_process(int argc, char * const argv[], cmd_tbl_t *cmdtp)
-{
-   u8 tpm_buffer[MAX_TRANSACTION_SIZE];
-   u32 write_size, read_size;
-   char *p;
-   int rv = -1;
-
-   for (write_size = 0; write_size < argc; write_size++) {
-   u32 datum = simple_strtoul(argv[write_size], &p, 0);
-   if (*p || (datum > 0xff)) {
-   printf("\n%s: bad data value\n\n", argv[write_size]);
-   cmd_usage(cmdtp);
-   return rv;
-   }
-   tpm_buffer[write_size] = (u8)datum;
+static void *parse_byte_string(char *bytes, uint8_t *data, size_t *count_ptr)
+{
+   char byte[3];
+   size_t count, length;
+   int i;
+
+   length = strlen(bytes);
+   count = length / 2;
+
+   if (!data)
+   data = malloc(count);
+   if (!data)
+   return NULL;
+
+   byte[2] = '\0';
+   for (i = 0; i < length; i += 2) {
+   byte[0] = bytes[i];
+   byte[1] = bytes[i + 1];
+   data[i / 2] = (uint8_t)simple_strtoul(byte, NULL, 16);
}
 
-   read_size = sizeof(tpm_buffer);
-   if (!tis_sendrecv(tpm_buffer, write_size, tpm_buffer, &read_size)) {
-   int i;
-   puts("Got TPM response:\n");
-   for (i = 0; i < read_size; i++)
-   printf(" %2.2x", tpm_buffer[i]);
-   puts("\n");
-   rv = 0;
-   } else {
-   puts("tpm command failed\n");
+   if (count_ptr)
+   *count_ptr = count;
+
+   return data;
+}
+
+/**
+ * Convert TPM command return code to U-Boot command error codes.
+ *
+ * @param return_code  TPM command return code
+ * @return value of enum command_ret_t
+ */
+static int convert_return_code(uint32_t return_code)
+{
+   if (return_code)
+

Re: [U-Boot] M29EW flash is detected as 0xFF

2013-02-28 Thread Jagan Teki
Hi Stefan,

On Fri, Feb 22, 2013 at 9:02 PM, Jagan Teki  wrote:
> Hi Stefan,
>
> On Thu, Feb 21, 2013 at 5:27 PM, Jagan Teki  wrote:
>> Hi Stefan,
>>
>> On Wed, Feb 20, 2013 at 11:44 PM, Stefan Roese  wrote:
>>> Hi Jagan,
>>>
>>> On 20.02.2013 18:25, Jagan Teki wrote:
> So please update to the latest version and try again.

 Sorry for not intimating the version I used, actually I am using the
 latest u-boot version 2013.01.01
 Below link the head commit for cfi_flash.c
 http://git.denx.de/?p=u-boot.git;a=commit;h=d2af028db3f75390f56f018e16c0f269521e07c5

 I am not sure whats wrong with code for detecting the m/c ID.

 Please let me know your inputs.
>>>
>>> This reminds me of a still pending problem with 8-bit flash chips. Could
>>> you perhaps give this patch a try?
>>>
>>> http://patchwork.ozlabs.org/patch/140863/
>>>
>>> Not sure if it still applies clean. But it seemed to fix a problem with
>>> 8-bit bus flash chips.
>>
>> I am able to detect the correct Manufacture ID and device ID with these 
>> changes.
>>
>> Bank # 1: CFI conformant flash (8 x 8)  Size: 64 MB in 512 Sectors
>>   AMD Standard command set, Manufacturer ID: 0x89, Device ID: 0x7E2301
>>   Erase timeout: 4096 ms, write timeout: 2 ms
>>   Buffer write timeout: 5 ms, buffer size: 1024 bytes
>>
>> But the 1024 bytes buffer size is another issues, as Numonyx CFI
>> wrongly mentioned 1024 instead of 256.
>> Any way that we can fix I guess for N29EW flashes..
>>
>> but how these changes impacts the other flashes i don't ..
>>
>> Please find the log message.
>
> I made a fix for hw cfi issue when device is operating in 8-bit mode,
> If the above changes are looks fine we may have this fix will solve
> the M29EW flashes operates under 8-bit mode.
>
> Could send your comments/views.
>
> Thanks,
> Jagan.

Could you please send your comments.

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


[U-Boot] [PATCH v3 4/4] am335x_evm: Enable DFU for NAND and MMC, provide example alt_info for both

2013-02-28 Thread Tom Rini
From: Pantelis Antoniou 

- Add CONFIG_DFU_NAND, CONFIG_DFU_MMC
- Set dfu_alt_info_nand and dfu_alt_info_mmc to show a working example
  for both.
- Increase CONFIG_SYS_MAXARGS due to hush parsing bugs that would
  otherwise disallow 'setenv dfu_alt_info ${dfu_alt_info_nand}'.
- Enable CONFIG_FAT_WRITE to allow updating on MMC

Signed-off-by: Pantelis Antoniou 
Signed-off-by: Tom Rini 
---
Changes in v3:
- Fix checkpatch.pl warnings in include/configs/am335x_evm.h

Changes in v2:
- Enable DFU for NAND and MMC, set dfu_alt_info_(nand|mmc) as examples
  for both in am335x_evm.h
- Increase CONFIG_SYS_MAXARGS due to hush parsing bugs that would
  otherwise prevent 'setenv dfu_alt_info ${dfu_alt_info_nand}' on
  am335x_evm

 include/configs/am335x_evm.h |   38 --
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 61b861d..14ffda7 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -62,6 +62,8 @@
"optargs=\0" \
"mtdids=" MTDIDS_DEFAULT "\0" \
"mtdparts=" MTDPARTS_DEFAULT "\0" \
+   "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
+   "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 ro\0" \
"mmcrootfstype=ext4 rootwait\0" \
@@ -118,8 +120,8 @@
 
 #define CONFIG_CMD_ECHO
 
-/* max number of command args */
-#define CONFIG_SYS_MAXARGS 16
+/* We set the max number of command args high to avoid HUSH bugs. */
+#define CONFIG_SYS_MAXARGS 64
 
 /* Console I/O Buffer Size */
 #define CONFIG_SYS_CBSIZE  512
@@ -148,6 +150,7 @@
 #define CONFIG_CMD_MMC
 #define CONFIG_DOS_PARTITION
 #define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
 #define CONFIG_CMD_EXT2
 
 #define CONFIG_SPI
@@ -158,6 +161,36 @@
 #define CONFIG_CMD_SF
 #define CONFIG_SF_DEFAULT_SPEED(2400)
 
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USB_GADGET
+#define CONFIG_USBDOWNLOAD_GADGET
+
+/* USB TI's IDs */
+#define CONFIG_USBD_HS
+#define CONFIG_G_DNL_VENDOR_NUM 0x0403
+#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
+#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
+
+/* USB Device Firmware Update support */
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+#define CONFIG_DFU_NAND
+#define CONFIG_CMD_DFU
+#define DFU_ALT_INFO_MMC \
+   "boot part 0 1;" \
+   "rootfs part 0 2;" \
+   "MLO fat 0 1;" \
+   "u-boot.img fat 0 1;" \
+   "uEnv.txt fat 0 1"
+#define DFU_ALT_INFO_NAND \
+   "SPL part 0 1;" \
+   "SPL.backup1 part 0 2;" \
+   "SPL.backup2 part 0 3;" \
+   "SPL.backup3 part 0 4;" \
+   "u-boot part 0 5;" \
+   "kernel part 0 7;" \
+   "rootfs part 0 8"
+
  /* Physical Memory Map */
 #define CONFIG_NR_DRAM_BANKS   1   /*  1 bank of DRAM */
 #define PHYS_DRAM_10x8000  /* DRAM Bank #1 */
@@ -302,6 +335,7 @@
 #define CONFIG_MUSB_GADGET
 #define CONFIG_MUSB_PIO_ONLY
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW2
 #define CONFIG_MUSB_HOST
 #define CONFIG_AM335X_USB0
 #define CONFIG_AM335X_USB0_MODEMUSB_PERIPHERAL
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 2/4] dfu: NAND specific routines for DFU operation

2013-02-28 Thread Tom Rini
From: Pantelis Antoniou 

Support for NAND storage devices to work with the DFU framework.

Signed-off-by: Pantelis Antoniou 
Signed-off-by: Tom Rini 
---
Changes in v3:
- Rework logic in nand_block_op for nand_(read|write)_skip_bad returning
  just a size for actual used length.
- Remove unused externs from drivers/dfu/dfu_nand.c

Changes in v2:
- nand_block_op calls nand_(read|write)_skip_bad directly.
- Bugfix in dfu_nand to make sure we set dfu->skip_bad to 0 on each
  iteration.

 drivers/dfu/Makefile   |1 +
 drivers/dfu/dfu.c  |8 ++
 drivers/dfu/dfu_nand.c |  195 
 include/dfu.h  |   23 ++
 4 files changed, 227 insertions(+)
 create mode 100644 drivers/dfu/dfu_nand.c

diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
index 7b717bc..153095d 100644
--- a/drivers/dfu/Makefile
+++ b/drivers/dfu/Makefile
@@ -27,6 +27,7 @@ LIB   = $(obj)libdfu.o
 
 COBJS-$(CONFIG_DFU_FUNCTION) += dfu.o
 COBJS-$(CONFIG_DFU_MMC) += dfu_mmc.o
+COBJS-$(CONFIG_DFU_NAND) += dfu_nand.o
 
 SRCS:= $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index fb9b417..44d29de 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -86,6 +86,7 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
/* initial state */
dfu->crc = 0;
dfu->offset = 0;
+   dfu->bad_skip = 0;
dfu->i_blk_seq_num = 0;
dfu->i_buf_start = dfu_buf;
dfu->i_buf_end = dfu_buf + sizeof(dfu_buf);
@@ -234,6 +235,8 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
dfu->i_buf = dfu->i_buf_start;
dfu->b_left = 0;
 
+   dfu->bad_skip = 0;
+
dfu->inited = 1;
}
 
@@ -263,6 +266,8 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
dfu->i_buf = dfu->i_buf_start;
dfu->b_left = 0;
 
+   dfu->bad_skip = 0;
+
dfu->inited = 0;
}
 
@@ -285,6 +290,9 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, 
int alt,
if (strcmp(interface, "mmc") == 0) {
if (dfu_fill_entity_mmc(dfu, s))
return -1;
+   } else if (strcmp(interface, "nand") == 0) {
+   if (dfu_fill_entity_nand(dfu, s))
+   return -1;
} else {
printf("%s: Device %s not (yet) supported!\n",
   __func__,  interface);
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
new file mode 100644
index 000..b7f60dd
--- /dev/null
+++ b/drivers/dfu/dfu_nand.c
@@ -0,0 +1,195 @@
+/*
+ * dfu_nand.c -- DFU for NAND routines.
+ *
+ * Copyright (C) 2012-2013 Texas Instruments, Inc.
+ *
+ * Based on dfu_mmc.c which is:
+ * Copyright (C) 2012 Samsung Electronics
+ * author: 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
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+enum dfu_nand_op {
+   DFU_OP_READ = 1,
+   DFU_OP_WRITE,
+};
+
+static int nand_block_op(enum dfu_nand_op op, struct dfu_entity *dfu,
+   u64 offset, void *buf, long *len)
+{
+   loff_t start;
+   size_t count, actual;
+   int ret;
+   int dev;
+   nand_info_t *nand;
+
+   /* if buf == NULL return total size of the area */
+   if (buf == NULL) {
+   *len = dfu->data.nand.size;
+   return 0;
+   }
+
+   start = dfu->data.nand.start + offset + dfu->bad_skip;
+   count = *len;
+   if (start + count >
+   dfu->data.nand.start + dfu->data.nand.size) {
+   printf("%s: block_op out of bounds\n", __func__);
+   return -1;
+   }
+
+   dev = nand_curr_device;
+   if (dev < 0 || dev >= CONFIG_SYS_MAX_NAND_DEVICE ||
+   !nand_info[dev].name) {
+   printf("%s: invalid nand device\n", __func__);
+   return -1;
+   }
+
+   nand = &nand_info[dev];
+
+   if (op == DFU_OP_READ)
+   ret = nand_read_skip_bad(nand, start, &count, &actual,
+   

[U-Boot] [PATCH v3 3/4] am335x_evm: Add CONFIG_CMD_MTDPARTS and relevant defaults

2013-02-28 Thread Tom Rini
Signed-off-by: Tom Rini 
---
Changes in v3: None
Changes in v2:
- Add CONFIG_CMD_MTDPARTS and relevant information to am335x_evm

 include/configs/am335x_evm.h |9 +
 1 file changed, 9 insertions(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 59647d1..61b861d 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -60,6 +60,8 @@
"fdtfile=\0" \
"console=ttyO0,115200n8\0" \
"optargs=\0" \
+   "mtdids=" MTDIDS_DEFAULT "\0" \
+   "mtdparts=" MTDPARTS_DEFAULT "\0" \
"mmcdev=0\0" \
"mmcroot=/dev/mmcblk0p2 ro\0" \
"mmcrootfstype=ext4 rootwait\0" \
@@ -341,6 +343,13 @@
 /* NAND support */
 #ifdef CONFIG_NAND
 #define CONFIG_CMD_NAND
+#define CONFIG_CMD_MTDPARTS
+#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
+#define MTDPARTS_DEFAULT   "mtdparts=omap2-nand.0:128k(SPL)," \
+   "128k(SPL.backup1)," \
+   "128k(SPL.backup2)," \
+   "128k(SPL.backup3),1920k(u-boot)," \
+   "128k(u-boot-env),5m(kernel),-(rootfs)"
 #define CONFIG_NAND_OMAP_GPMC
 #define GPMC_NAND_ECC_LP_x16_LAYOUT1
 #define CONFIG_SYS_NAND_BASE   (0x0800)/* physical address */
-- 
1.7.9.5

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


[U-Boot] [PATCH v3 1/4] nand: Extend nand_(read|write)_skip_bad with *actual and limit parameters

2013-02-28 Thread Tom Rini
We make these two functions take a size_t pointer to how much space
was used on NAND to read or write the buffer (when reads/writes happen)
so that bad blocks can be accounted for.  We also make them take an
loff_t limit on how much data can be read or written.  This means that
we can now catch the case of when writing to a partition would exceed
the partition size due to bad blocks.  To do this we also need to make
check_skip_len count not just complete blocks used but partial ones as
well.  All callers of nand_(read|write)_skip_bad are adjusted to call
these with the most sensible limits available.

The changes were started by Pantelis and finished by Tom.

Signed-off-by: Pantelis Antoniou 
Signed-off-by: Tom Rini 
---
Changes in v3:
- Reworked skip_check_len changes to just add accounting for *used to
  the logic.
- Allow for actual to be NULL in nand_(read|write)_skip_bad, only DFU
  calls this with a non-NULL parameter.  Make sure the comments for both
  functions explain the parameters and their behavior.
- Other style changes requested by Scott.
- As nand_(write|read)_skip_bad passes back just a used length now.

Changes in v2:
- NAND skip_check_len changes reworked to allow
  nand_(read|write)_skip_bad to return this information to the caller.

 common/cmd_nand.c|   56 +++
 common/env_nand.c|3 +-
 drivers/mtd/nand/nand_util.c |   67 +-
 include/nand.h   |4 +--
 4 files changed, 93 insertions(+), 37 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 495610c..0b07b8e 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -137,7 +137,8 @@ static inline int str2long(const char *p, ulong *num)
return *p != '\0' && *endptr == '\0';
 }
 
-static int get_part(const char *partname, int *idx, loff_t *off, loff_t *size)
+static int get_part(const char *partname, int *idx, loff_t *off, loff_t *size,
+   loff_t *maxsize)
 {
 #ifdef CONFIG_CMD_MTDPARTS
struct mtd_device *dev;
@@ -160,6 +161,7 @@ static int get_part(const char *partname, int *idx, loff_t 
*off, loff_t *size)
 
*off = part->offset;
*size = part->size;
+   *maxsize = part->size;
*idx = dev->id->num;
 
ret = set_dev(*idx);
@@ -173,10 +175,11 @@ static int get_part(const char *partname, int *idx, 
loff_t *off, loff_t *size)
 #endif
 }
 
-static int arg_off(const char *arg, int *idx, loff_t *off, loff_t *maxsize)
+static int arg_off(const char *arg, int *idx, loff_t *off, loff_t *size,
+   loff_t *maxsize)
 {
if (!str2off(arg, off))
-   return get_part(arg, idx, off, maxsize);
+   return get_part(arg, idx, off, size, maxsize);
 
if (*off >= nand_info[*idx].size) {
puts("Offset exceeds device limit\n");
@@ -184,40 +187,34 @@ static int arg_off(const char *arg, int *idx, loff_t 
*off, loff_t *maxsize)
}
 
*maxsize = nand_info[*idx].size - *off;
+   *size = *maxsize;
return 0;
 }
 
 static int arg_off_size(int argc, char *const argv[], int *idx,
-   loff_t *off, loff_t *size)
+   loff_t *off, loff_t *size, loff_t *maxsize)
 {
int ret;
-   loff_t maxsize = 0;
 
if (argc == 0) {
*off = 0;
*size = nand_info[*idx].size;
+   *maxsize = *size;
goto print;
}
 
-   ret = arg_off(argv[0], idx, off, &maxsize);
+   ret = arg_off(argv[0], idx, off, size, maxsize);
if (ret)
return ret;
 
-   if (argc == 1) {
-   *size = maxsize;
+   if (argc == 1)
goto print;
-   }
 
if (!str2off(argv[1], size)) {
printf("'%s' is not a number\n", argv[1]);
return -1;
}
 
-   if (*size > maxsize) {
-   puts("Size exceeds partition or device limit\n");
-   return -1;
-   }
-
 print:
printf("device %d ", *idx);
if (*size == nand_info[*idx].size)
@@ -307,7 +304,8 @@ int do_nand_env_oob(cmd_tbl_t *cmdtp, int argc, char *const 
argv[])
if (argc < 3)
goto usage;
 
-   if (arg_off(argv[2], &idx, &addr, &maxsize)) {
+   /* We don't care about size, or maxsize. */
+   if (arg_off(argv[2], &idx, &addr, &maxsize, &maxsize)) {
puts("Offset or partition name expected\n");
return 1;
}
@@ -432,7 +430,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 {
int i, ret = 0;
ulong addr;
-   loff_t off, size;
+   loff_t off, size, maxsize;
char *cmd, *s;
nand_info_t *nand;
 #ifdef CONFIG_SYS_NAND_QUIET
@@ -557,7 +555,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 

[U-Boot] [PATCH v3 0/4] Add NAND support to DFU, enable for am335x_evm

2013-02-28 Thread Tom Rini
This series adds DFU support to NAND and was started by Pantelis.  The
NAND changes have been compile-tested on all ARM and PowerPC targets and
run-time tested on ARM.  DFU itself has been tested, for NAND, on
am335x_evm.

For practical reasons, this series depends on Pantelis' previous series
of generic DFU changes.  Lukasz and I are discussing how to handle a few
changes there since one of them breaks file writing.

--
Tom

Changes in v3:
- Reworked skip_check_len changes to just add accounting for *used to
  the logic.
- Allow for actual to be NULL in nand_(read|write)_skip_bad, only DFU
  calls this with a non-NULL parameter.  Make sure the comments for both
  functions explain the parameters and their behavior.
- Other style changes requested by Scott.
- As nand_(write|read)_skip_bad passes back just a used length now.
- Rework logic in nand_block_op for nand_(read|write)_skip_bad returning
  just a size for actual used length.
- Remove unused externs from drivers/dfu/dfu_nand.c
- Fix checkpatch.pl warnings in include/configs/am335x_evm.h

Changes in v2:
- NAND skip_check_len changes reworked to allow
  nand_(read|write)_skip_bad to return this information to the caller.
- nand_block_op calls nand_(read|write)_skip_bad directly.
- Bugfix in dfu_nand to make sure we set dfu->skip_bad to 0 on each
  iteration.
- Add CONFIG_CMD_MTDPARTS and relevant information to am335x_evm
- Enable DFU for NAND and MMC, set dfu_alt_info_(nand|mmc) as examples
  for both in am335x_evm.h
- Increase CONFIG_SYS_MAXARGS due to hush parsing bugs that would
  otherwise prevent 'setenv dfu_alt_info ${dfu_alt_info_nand}' on
  am335x_evm

Pantelis Antoniou (2):
  dfu: NAND specific routines for DFU operation
  am335x_evm: Enable DFU for NAND and MMC, provide example alt_info for
both

Tom Rini (2):
  nand: Extend nand_(read|write)_skip_bad with *actual and limit
parameters
  am335x_evm: Add CONFIG_CMD_MTDPARTS and relevant defaults

 common/cmd_nand.c|   56 ++--
 common/env_nand.c|3 +-
 drivers/dfu/Makefile |1 +
 drivers/dfu/dfu.c|8 ++
 drivers/dfu/dfu_nand.c   |  195 ++
 drivers/mtd/nand/nand_util.c |   67 +--
 include/configs/am335x_evm.h |   47 +-
 include/dfu.h|   23 +
 include/nand.h   |4 +-
 9 files changed, 365 insertions(+), 39 deletions(-)
 create mode 100644 drivers/dfu/dfu_nand.c

-- 
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] mxs: timrot: Rename local macros

2013-02-28 Thread Marek Vasut
Dear Fadil Berisha,

> From: Fadil Berisha 
> 
> Local macros apply to both iMX23 and iMX28. This patch renames local
> macros with attribute MX28 to MXS.
> 
> Signed-off-by: Fadil Berisha 
> Cc: Marek Vasut 
> Cc: Otavio Salvador 
> Cc: Fabio Estevam 
> Cc: Stefano Babic 
> ---

Acked-by: Marek Vasut 

NOTE: I did not receive this email, maybe your mailer is broken and doesn't 
handle the Cc properly?

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] mxs: spl_mem_init: Align DDR2 init with FSL bootlets source

2013-02-28 Thread Marek Vasut
Dear Fabio Estevam,

> From: Fabio Estevam 
> 
> Currently the following kernel hang happens when loading a 2.6.35 kernel
> from Freeescale on a mx28evk board:
> 
> RPC: Registered tcp transport module.
> RPC: Registered tcp NFSv4.1 backchannel transport module.
> Bus freq driver module loaded
> IMX usb wakeup probe
> usb h1 wakeup device is registered
> mxs_cpu_init: cpufreq init finished
> ...
> 
> Loading the same kernel using the bootlets from the
> imx-bootlets-src-10.12.01 package, the hang does not occur.
> 
> Comparing the DDR2 initialization from the bootlets code against the U-boot
> one, we can notice some mismatches, and after applying the same
> initialization into U-boot the 2.6.35 kernel can boot normally.
> 
> Also tested with 'mtest' command, which runs succesfully.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c |   87
> ++--- 1 file changed, 43 insertions(+), 44
> deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
> b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c index f8392f6..d80746f 100644
> --- a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
> @@ -36,55 +36,54 @@ static uint32_t dram_vals[] = {
>   * i.MX28 DDR2 at 200MHz
>   */

The patch contains mixed tabs and spaces. It is very tough to find the actual 
difference. Can you please reduce the patch to minimum? Can you also describe 
exactly what changed so I can verify this on other boards?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2013 01:50 PM, Marek Vasut wrote:
> Dear Tom Rini,
> 
>> On Tue, Feb 26, 2013 at 12:33:52PM +0100, Beno??t Th??baudeau
>> wrote:
>>> On Tuesday, February 26, 2013 8:19:42 AM, Marek Vasut wrote:
 Dear Beno??t Th??baudeau,
 
> Dear Scott Wood,
> 
> On Tuesday, February 26, 2013 12:07:25 AM, Scott Wood
> wrote:
>> On 02/25/2013 05:03:30 PM, Marek Vasut wrote:
>>> Dear Scott Wood,
>>> 
 So maybe we need a more general (but optional) 
 CONFIG_BUILD_TARGET.
>>> 
>>> Can you elaborate?
>> 
>> Same as CONFIG_SPL_TARGET, but not SPL-specific.
>> Basically a way for a board config file to add to
>> $(ALL-y).
>> 
 So each one would set the appropriate
 CONFIG_BUILD_TARGET for
>>> 
>>> whatever
>>> 
 needs to get built, and then something like
 CONFIG_NAND_IMAGE could hold the image name that
 should be linked to produce a standard
 u-boot-nand.bin output.
>>> 
>>> Yea, sounds reasonable. But why call it CONFIG_ , it
>>> can't be stored in the board.h files, it has to be
>>> somewhere in the Makefile hierarchy.
>> 
>> Why can't it go in the board.h files?
> 
> We could do all that, but should we? As I said to Marek, I
> think that it's a big mistake to omit the SPL here. The
> only other solution to get a reliable boot would be the
> DBBT, but it's very hard to use in real life, away from a
> production line. The SPL is really easy to enable here, and
> it's only a matter of time before someone gets bitten by
> this lack of reliability, so why not just do things right? 
> The boot time and footprint of an SPL would really be
> negligible, and it's not because other implementations omit
> both SPL and a valid DBBT that U-Boot should do the same.
 
 I'm not against SPL, but then we're starting to drift away
 from the whole idea of generating u-boot-nand.bin or similar
 image. Being able to generate u-boot- nand.bin or
 u-boot-sd.bin etc ... on a per-CPU basis (since this is CPU 
 specific) is the ultimate goal here, whatever is embedded in
 the image.
>>> 
>>> OK, I didn't know that this was your goal here. If the contents
>>> of the image do not matter, then my u-boot-with-nand-spl.imx
>>> could be renamed into your u-boot-nand.bin with the appropriate
>>> FCB header, and CONFIG_SPL_TARGET could be changed to something
>>> more generic as Scott explained.
>> 
>> I wonder how the rules start looking.  In the end, some way to
>> say "Here is the image to write to NAND, called u-boot-nand.bin"
>> which will have whatever board needs (say spl/u-boot-spl.bin +
>> some header attached followed by pad, followed by u-boot.img).
>> And also allow for u-boot-nand.bin to be what someone else needs
>> (say a different header on u-boot-spl.bin), etc.
> 
> They'd be CPU specific rules, so that depends on the CPU really.

Yes, they'd have to have a level of granularity (and
cross-sharability) to them.  Which is why I wonder how it would all
look, since it needs to look on the clean side.  I'm expressing a
desire to use these rules on non-Freescale parts right away, so long
as the infrastructure is done right.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRL6exAAoJENk4IS6UOR1WR60QAJ8UGeXt1xe/bAOYQkacmgSK
g03ZEWFIRZiQIogcnR7hzk2eiIb2zqCPHRtpnEIumOVpaOMISN/DKKeI5XbyQIiA
GOW8UgTnqQ0Inr6Uoo2gwRqsPS3G9qDVPd3ZeZXo1rU48h+j3jAH5feelcwmVaFx
koef5+5GpQUsaah203w5g6PSDz/+r2unud5ZptK+Fzw4yQmBHgnOET99tlRtg/pQ
v0pOKDDtwh+Y/xyhV56iZrchnGBIfL05w1O2Urb+SDFvwZLyNjO4bmh4ZuNH+v1c
z2dxDWo+V57hfqKiqeQwT3Bz55WiUMGamMSW13xyK0vuNZz+m66PpF9tOdUUizlt
lkn2U1O++KPi+POXWzu9ILD00U2m5K5fHhMmfVCP+hJuJu26ada5rFaufkYqDU0p
ksxcPmvH+9gz4swc+fNGONQGNcGLde2x1nboLVYn8Gfh0Ckcc8Bhh6aJt4VOU0ID
LLVay1vbq5uCe1MPX2uHkZ5ZZrgms5L8ZFwWcjG2K/BnbA7Rg4pri/SOICiH27P9
B8qKb8myhKrtup91wHnCeCKi7PSY69kZRpKevkrFirdq4rY5XDVBlSeCGlfvMk49
i5gi6vov1BclBRIgIh1+fUIN8R6Cg7Eo30j9ptitzM9R6V7sLTu3CMl+GvCTHWwN
E44z2bb+9GJyB1M/+ZVL
=SxUx
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Marek Vasut
Dear Tom Rini,

> On Tue, Feb 26, 2013 at 12:33:52PM +0100, Beno??t Th??baudeau wrote:
> > On Tuesday, February 26, 2013 8:19:42 AM, Marek Vasut wrote:
> > > Dear Beno??t Th??baudeau,
> > > 
> > > > Dear Scott Wood,
> > > > 
> > > > On Tuesday, February 26, 2013 12:07:25 AM, Scott Wood wrote:
> > > > > On 02/25/2013 05:03:30 PM, Marek Vasut wrote:
> > > > > > Dear Scott Wood,
> > > > > > 
> > > > > > > So maybe we need a more general (but optional)
> > > > > > > CONFIG_BUILD_TARGET.
> > > > > > 
> > > > > > Can you elaborate?
> > > > > 
> > > > > Same as CONFIG_SPL_TARGET, but not SPL-specific.  Basically a way
> > > > > for a board config file to add to $(ALL-y).
> > > > > 
> > > > > > > So each one would set the appropriate CONFIG_BUILD_TARGET for
> > > > > > 
> > > > > > whatever
> > > > > > 
> > > > > > > needs to get built, and then something like CONFIG_NAND_IMAGE
> > > > > > > could hold the image name that should be linked to produce a
> > > > > > > standard u-boot-nand.bin output.
> > > > > > 
> > > > > > Yea, sounds reasonable. But why call it CONFIG_ , it can't be
> > > > > > stored in the
> > > > > > board.h files, it has to be somewhere in the Makefile hierarchy.
> > > > > 
> > > > > Why can't it go in the board.h files?
> > > > 
> > > > We could do all that, but should we? As I said to Marek, I think that
> > > > it's a big mistake to omit the SPL here. The only other solution to
> > > > get a reliable boot would be the DBBT, but it's very hard to use in
> > > > real life, away from a production line. The SPL is really easy to
> > > > enable here, and it's only a matter of time before someone gets
> > > > bitten by this lack of reliability, so why not just do things right?
> > > > The boot time and footprint of an SPL would really be negligible,
> > > > and it's not because other implementations omit both SPL and a valid
> > > > DBBT that U-Boot should do the same.
> > > 
> > > I'm not against SPL, but then we're starting to drift away from the
> > > whole idea
> > > of generating u-boot-nand.bin or similar image. Being able to generate
> > > u-boot-
> > > nand.bin or u-boot-sd.bin etc ... on a per-CPU basis (since this is CPU
> > > specific) is the ultimate goal here, whatever is embedded in the image.
> > 
> > OK, I didn't know that this was your goal here. If the contents of the
> > image do not matter, then my u-boot-with-nand-spl.imx could be renamed
> > into your u-boot-nand.bin with the appropriate FCB header, and
> > CONFIG_SPL_TARGET could be changed to something more generic as Scott
> > explained.
> 
> I wonder how the rules start looking.  In the end, some way to say "Here
> is the image to write to NAND, called u-boot-nand.bin" which will have
> whatever board needs (say spl/u-boot-spl.bin + some header attached
> followed by pad, followed by u-boot.img).  And also allow for
> u-boot-nand.bin to be what someone else needs (say a different header on
> u-boot-spl.bin), etc.

They'd be CPU specific rules, so that depends on the CPU really.

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] Tegra30: Cardhu: Remove unneeded cardhu.c.mmc file

2013-02-28 Thread Stephen Warren
On 02/28/2013 09:30 AM, Tom Warren wrote:
> This was an older debug/developmental file that got added
> accidentally. Not needed/used in any Cardhu build.

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


Re: [U-Boot] [PATCH 1/3] ARM: implement some Cortex-A9 errata workarounds

2013-02-28 Thread Stephen Warren
On 02/26/2013 03:28 PM, Stephen Warren wrote:
> From: Stephen Warren 
> 
> Various errata exist in the Cortex-A9 CPU, and may be worked around by
> setting some bits in a CP15 diagnostic register. Add code to implement
> the workarounds, enabled by new CONFIG_ options.
> 
> This code was taken from the Linux kernel, v3.8, arch/arm/mm/proc-v7.S,
> and modified to remove the logic to conditionally apply the WAR (since we
> know exactly which CPU we're running on given the U-Boot configuration),
> and use r0 instead of r10 for consistency with the rest of U-Boot's
> cpu_init_cp15().

Hmmm. Lets hold off on this series; there are some conditions under
which the kernel has to be able to apply these WARs anyway (e.g. SMP CPU
power saving), which may impact which of the WARs the bootloader should
apply even when booting the initial CPU 0. I'll repost once that's been
resolved.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2013 11:29 AM, Benoît Thébaudeau wrote:
> On Thursday, February 28, 2013 5:21:55 PM, Tom Rini wrote:
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
>> 
>> On 02/28/2013 11:06 AM, Benoît Thébaudeau wrote:
>>> Hi Tom,
>>> 
>>> On Thursday, February 28, 2013 4:24:22 PM, Benoît Thébaudeau 
>>> wrote:
 Hi Tom,
 
 On Thursday, February 28, 2013 3:03:09 PM, Tom Rini write:
> On Wed, Feb 27, 2013 at 11:18:48PM +0100, Beno??t 
> Th??baudeau wrote:
>> Hi Marek,
>> 
>> On Monday, February 25, 2013 7:19:54 PM, Marek Vasut 
>> wrote:
>>> Implement u-boot.nand target that can be reused with a
>>>  small amount of churn across all CPU models. The idea 
>>> is to delegate the u-boot.nand target out of the main 
>>> Makefile and into the CPU's Makefile (very similar to 
>>> what u-boot.imx does now). The main Makefile shall only
>>> contain path to which the u-boot.nand target is 
>>> delegated. Hopefully this will not produce too much 
>>> bloat in the main Makefile.
>>> 
>>> To demonstrate this implementation, add u-boot.nand 
>>> target for i.MX53.
>>> 
>>> Signed-off-by: Marek Vasut  Cc: Beno??t
>>>  Th??baudeau  Cc: Fabio
>>>  Estevam  Cc: Stefano 
>>> Babic  --- Makefile |   18
>>> ++ arch/arm/imx-common/Makefile |6
>>> ++ 2 files changed, 24 insertions(+)
>>> 
>>> diff --git a/Makefile b/Makefile index 41054b7..8b1010a
>>> 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23
>>> @@ $(obj)u-boot.img:$(obj)u-boot.bin $(obj)u-boot.imx:
>>> $(obj)u-boot.bin depend $(MAKE) -C 
>>> $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx
>>> 
>>> +# +# Generic u-boot.nand target. +# +# Every CPU that
>>>  needs u-boot.nand must add a path to an
>>> implementation of +# the actual u-boot.nand generator
>>> below. +# +ifdef CONFIG_MX53 +CONFIG_NAND_TRG_PATH := 
>>> $(SRCTREE)/arch/arm/imx-common +endif + 
>>> +$(obj)u-boot.nand: $(obj)u-boot.bin depend +   if [ 
>>> "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ + echo
>>> "This CPU does not support u-boot.nand target!" ; \ +
>>> exit 1 ;\ + 
>>> fi + $(MAKE) -C 
>>> $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand + 
>>> $(obj)u-boot.kwb: $(obj)u-boot.bin $(obj)tools/mkimage 
>>> -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ -a 
>>> $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d 
>>> $< $@ @@ -857,6 +874,7 @@ clobber:  tidy @rm -f 
>>> $(obj)u-boot.kwb @rm -f $(obj)u-boot.pbl @rm -f 
>>> $(obj)u-boot.imx +  @rm -f $(obj)u-boot.nand @rm -f 
>>> $(obj)u-boot.ubl @rm -f $(obj)u-boot.ais @rm -f 
>>> $(obj)u-boot.dtb diff --git 
>>> a/arch/arm/imx-common/Makefile 
>>> b/arch/arm/imx-common/Makefile index 5d5c5b2..71ea36f 
>>> 100644 --- a/arch/arm/imx-common/Makefile +++ 
>>> b/arch/arm/imx-common/Makefile @@ -50,6 +50,12 @@ 
>>> $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin 
>>> $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX 
>>> $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T 
>>> imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
>>> 
>>> +$(obj)u-boot.nand: $(obj)u-boot.imx +  (   
>>> \ + 
>>> echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ;   \
>> ^ It does not work in my environment (Ubuntu 12.10). -ne 
>> is interpreted as text, so the FCB is broken. This is 
>> because /bin/sh (set to dash) is invoked by default on
>> my machine here. It would work with the /bin/bash set by
>> the main Makefile for SHELL, but this is not passed to
>> the sub-make.
>> 
>> So what do you think we should do: 1) Add "export SHELL" 
>> to the main Makefile? 2) Move the SHELL assignment from 
>> the main Makefile to the top-level config.mk? 3) Set 
>> "SHELL=$(SHELL)" on the command line when invoking the 
>> sub-make? 4) Use printf instead of echo? 5) Something 
>> else?
>> 
>> I like 1). Do you see possible side effects?
> 
> Wait!  We do 1 already and have for years (cf7a7b99), so 
> what's going on?
 
 Indeed! But I get anyway SHELL set to /bin/bash in /Makefile,
 and to /bin/sh in /arch/arm/imx-common/makefile.
 
 I don't see SHELL being set anywhere else, and $(MAKE) 
 SHELL=$(SHELL) works.
 
 That's really weird. It's like SHELL export was ignored, or 
 applied before the assignment. I will further dig into this.
>>> 
>>> From "5.3.2 Choosing the Shell" in the make manual, it seems 
>>> impossible to force make to use SHELL from the environment, 
>>> even with export. The note about SHELL in "5.7.2 Communicating
>>>  Variables to a Sub-make" can be misleading however.
>>> 
>>> Without "export SHELL", the recipe

Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Benoît Thébaudeau
On Thursday, February 28, 2013 5:21:55 PM, Tom Rini wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 02/28/2013 11:06 AM, Benoît Thébaudeau wrote:
> > Hi Tom,
> > 
> > On Thursday, February 28, 2013 4:24:22 PM, Benoît Thébaudeau
> > wrote:
> >> Hi Tom,
> >> 
> >> On Thursday, February 28, 2013 3:03:09 PM, Tom Rini write:
> >>> On Wed, Feb 27, 2013 at 11:18:48PM +0100, Beno??t Th??baudeau
> >>> wrote:
>  Hi Marek,
>  
>  On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote:
> > Implement u-boot.nand target that can be reused with a
> > small amount of churn across all CPU models. The idea is
> > to delegate the u-boot.nand target out of the main
> > Makefile and into the CPU's Makefile (very similar to what
> >  u-boot.imx does now). The main Makefile shall only
> > contain path to which the u-boot.nand target is delegated.
> > Hopefully this will not produce too much bloat in the main
> > Makefile.
> > 
> > To demonstrate this implementation, add u-boot.nand target
> > for i.MX53.
> > 
> > Signed-off-by: Marek Vasut  Cc: Beno??t
> > Th??baudeau  Cc: Fabio
> > Estevam  Cc: Stefano Babic
> >  --- Makefile |   18
> > ++ arch/arm/imx-common/Makefile |6
> > ++ 2 files changed, 24 insertions(+)
> > 
> > diff --git a/Makefile b/Makefile index 41054b7..8b1010a
> > 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23 @@
> > $(obj)u-boot.img:   $(obj)u-boot.bin $(obj)u-boot.imx:
> > $(obj)u-boot.bin depend $(MAKE) -C
> > $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx
> > 
> > +# +# Generic u-boot.nand target. +# +# Every CPU that
> > needs u-boot.nand must add a path to an implementation of
> > +# the actual u-boot.nand generator below. +# +ifdef
> > CONFIG_MX53 +CONFIG_NAND_TRG_PATH :=
> > $(SRCTREE)/arch/arm/imx-common +endif +
> > +$(obj)u-boot.nand: $(obj)u-boot.bin depend +   if [
> > "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then \ + 
> > echo
> > "This CPU does not support u-boot.nand target!" ;   \ +
> > exit 1 ;\ + 
> > fi + $(MAKE) -C $(CONFIG_NAND_TRG_PATH)
> > $(obj)u-boot.nand + $(obj)u-boot.kwb:
> > $(obj)u-boot.bin $(obj)tools/mkimage -n
> > $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ -a
> > $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> > @@ -857,6 +874,7 @@ clobber:tidy @rm -f $(obj)u-boot.kwb
> > @rm -f $(obj)u-boot.pbl @rm -f $(obj)u-boot.imx +   @rm -f
> > $(obj)u-boot.nand @rm -f $(obj)u-boot.ubl @rm -f
> > $(obj)u-boot.ais @rm -f $(obj)u-boot.dtb diff --git
> > a/arch/arm/imx-common/Makefile
> > b/arch/arm/imx-common/Makefile index 5d5c5b2..71ea36f
> > 100644 --- a/arch/arm/imx-common/Makefile +++
> > b/arch/arm/imx-common/Makefile @@ -50,6 +50,12 @@
> > $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin
> > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX
> > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T
> > imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> > 
> > +$(obj)u-boot.nand: $(obj)u-boot.imx +  (   
> > \ + echo
> > -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ;\
>  ^ It does not work in my environment (Ubuntu 12.10). -ne is
>  interpreted as text, so the FCB is broken. This is because
>  /bin/sh (set to dash) is invoked by default on my machine
>  here. It would work with the /bin/bash set by the main
>  Makefile for SHELL, but this is not passed to the sub-make.
>  
>  So what do you think we should do: 1) Add "export SHELL" to
>  the main Makefile? 2) Move the SHELL assignment from the
>  main Makefile to the top-level config.mk? 3) Set
>  "SHELL=$(SHELL)" on the command line when invoking the
>  sub-make? 4) Use printf instead of echo? 5) Something else?
>  
>  I like 1). Do you see possible side effects?
> >>> 
> >>> Wait!  We do 1 already and have for years (cf7a7b99), so
> >>> what's going on?
> >> 
> >> Indeed! But I get anyway SHELL set to /bin/bash in /Makefile,
> >> and to /bin/sh in /arch/arm/imx-common/makefile.
> >> 
> >> I don't see SHELL being set anywhere else, and $(MAKE)
> >> SHELL=$(SHELL) works.
> >> 
> >> That's really weird. It's like SHELL export was ignored, or
> >> applied before the assignment. I will further dig into this.
> > 
> > From "5.3.2 Choosing the Shell" in the make manual, it seems
> > impossible to force make to use SHELL from the environment, even
> > with export. The note about SHELL in "5.7.2 Communicating
> > Variables to a Sub-make" can be misleading however.
> > 
> > Without "export SHELL", the recipes are executed with the set
> > SHELL, but the default value of SHELL is in their environment.
> > 
> > With "

[U-Boot] [PATCH] Tegra30: Cardhu: Remove unneeded cardhu.c.mmc file

2013-02-28 Thread Tom Warren
This was an older debug/developmental file that got added
accidentally. Not needed/used in any Cardhu build.

Signed-off-by: Tom Warren 
---
This errant file exists in u-boot-tegra/next, u-boot-arm/master, and
u-boot/master (TOT). I'll remove it from u-boot-tegra/next, so it'll
trickle upstream into ARM and TOT U-Boot, or those custodians can apply
this patch and remove it now if they wish.

 board/nvidia/cardhu/cardhu.c.mmc |  151 --
 1 files changed, 0 insertions(+), 151 deletions(-)
 delete mode 100644 board/nvidia/cardhu/cardhu.c.mmc

diff --git a/board/nvidia/cardhu/cardhu.c.mmc b/board/nvidia/cardhu/cardhu.c.mmc
deleted file mode 100644
index 9e83b6f..000
--- a/board/nvidia/cardhu/cardhu.c.mmc
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *  (C) Copyright 2010-2012
- *  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 "pinmux-config-cardhu.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/*
- * Routine: pinmux_init
- * Description: Do individual peripheral pinmux configs
- */
-void pinmux_init(void)
-{
-   pinmux_config_table(tegra3_pinmux_common,
-   ARRAY_SIZE(tegra3_pinmux_common));
-
-   pinmux_config_table(unused_pins_lowpower,
-   ARRAY_SIZE(unused_pins_lowpower));
-}
-
-#if defined(CONFIG_MMC)
-/*
- * Routine: pin_mux_mmc
- * Description: setup the pin muxes/tristate values for the SDMMC(s)
- */
-static void pin_mux_mmc(void)
-{
-}
-
-/* Do I2C/PMU writes to bring up SD card bus power */
-static void board_sdmmc_voltage_init(void)
-{
-uchar reg, data_buffer[1];
-int i;
-
-i2c_set_bus_num(0); /* PMU is on bus 0 */
-
-data_buffer[0] = 0x65;
-reg = 0x32;
-
-for (i = 0; i < MAX_I2C_RETRY; ++i) {
-if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
-udelay(100);
-}
-
-data_buffer[0] = 0x09;
-reg = 0x67;
-
-for (i = 0; i < MAX_I2C_RETRY; ++i) {
-if (i2c_write(PMU_I2C_ADDRESS, reg, 1, data_buffer, 1))
-udelay(100);
-}
-}
-
-static void pad_init_mmc(struct tegra_mmc *reg)
-{
-struct apb_misc_gp_ctlr *const gpc =
-(struct apb_misc_gp_ctlr *)NV_PA_APB_MISC_GP_BASE;
-struct sdmmc_ctlr *const sdmmc = (struct sdmmc_ctlr *)reg;
-u32 val, offset = (unsigned int)reg;
-u32 padcfg, padmask;
-
-debug("%s: sdmmc address = %08x\n", __func__, (unsigned int)sdmmc);
-
-/* Set the pad drive strength for SDMMC1 or 3 only */
-if (offset != TEGRA_SDMMC1_BASE && offset != TEGRA_SDMMC3_BASE) {
-debug("%s: settings are only valid for SDMMC1/SDMMC3!\n",
-__func__);
-return;
-}
-
-/* Set pads as per T30 TRM, section 24.6.1.2 */
-padcfg = (GP_SDIOCFG_DRVUP_SLWF | GP_SDIOCFG_DRVDN_SLWR | \
-GP_SDIOCFG_DRVUP | GP_SDIOCFG_DRVDN);
-padmask = 0x0FFF;
-if (offset == TEGRA_SDMMC1_BASE) {
-val = readl(&gpc->sdio1cfg);
-val &= padmask;
-val |= padcfg;
-writel(val, &gpc->sdio1cfg);
-} else {/* SDMMC3 */
-val = readl(&gpc->sdio3cfg);
-val &= padmask;
-val |= padcfg;
-writel(val, &gpc->sdio3cfg);
-}
-
-val = readl(&sdmmc->sdmmc_sdmemcomp_pad_ctrl);
-val &= 0xFFF0;
-val |= MEMCOMP_PADCTRL_VREF;
-writel(val, &sdmmc->sdmmc_sdmemcomp_pad_ctrl);
-
-val = readl(&sdmmc->sdmmc_auto_cal_config);
-val &= 0x;
-val |= AUTO_CAL_PU_OFFSET | AUTO_CAL_PD_OFFSET | AUTO_CAL_ENABLED;
-writel(val, &sdmmc->sdmmc_auto_cal_config);
-}
-
-/* this is a weak define that we are overriding */
-int board_mmc_init(bd_t *bd)
-{
-   debug("board_mmc_init called\n");
-
-   /* Turn on SD-card bus power */
-   board_sdmmc_voltage_init();
-
-   /* Set up the SDMMC pads as per the TRM */
-   pad_init_mmc((struct tegr

Re: [U-Boot] [PATCH v4] mxs: timrot: Add support to i.MX23

2013-02-28 Thread Otavio Salvador
On Thu, Feb 28, 2013 at 12:00 AM, Fadil Berisha  wrote:
> From: Fadil Berisha 
>
> This patch add timer support to i.MX23 and complete bit fields and values
> on regs-timrot.h.
> Testet on imx23-olinuxino board.
>
> Signed-off-by: Fadil Berisha 
> Acked-by: Marek Vasut 

Acked-by: Otavio Salvador 


-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/28/2013 11:06 AM, Benoît Thébaudeau wrote:
> Hi Tom,
> 
> On Thursday, February 28, 2013 4:24:22 PM, Benoît Thébaudeau 
> wrote:
>> Hi Tom,
>> 
>> On Thursday, February 28, 2013 3:03:09 PM, Tom Rini write:
>>> On Wed, Feb 27, 2013 at 11:18:48PM +0100, Beno??t Th??baudeau 
>>> wrote:
 Hi Marek,
 
 On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote:
> Implement u-boot.nand target that can be reused with a 
> small amount of churn across all CPU models. The idea is
> to delegate the u-boot.nand target out of the main
> Makefile and into the CPU's Makefile (very similar to what
>  u-boot.imx does now). The main Makefile shall only
> contain path to which the u-boot.nand target is delegated. 
> Hopefully this will not produce too much bloat in the main 
> Makefile.
> 
> To demonstrate this implementation, add u-boot.nand target 
> for i.MX53.
> 
> Signed-off-by: Marek Vasut  Cc: Beno??t 
> Th??baudeau  Cc: Fabio 
> Estevam  Cc: Stefano Babic 
>  --- Makefile |   18 
> ++ arch/arm/imx-common/Makefile |6 
> ++ 2 files changed, 24 insertions(+)
> 
> diff --git a/Makefile b/Makefile index 41054b7..8b1010a 
> 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,23 @@ 
> $(obj)u-boot.img: $(obj)u-boot.bin $(obj)u-boot.imx: 
> $(obj)u-boot.bin depend $(MAKE) -C 
> $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx
> 
> +# +# Generic u-boot.nand target. +# +# Every CPU that 
> needs u-boot.nand must add a path to an implementation of 
> +# the actual u-boot.nand generator below. +# +ifdef 
> CONFIG_MX53 +CONFIG_NAND_TRG_PATH := 
> $(SRCTREE)/arch/arm/imx-common +endif +
> +$(obj)u-boot.nand: $(obj)u-boot.bin depend + if [
> "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then   \ + 
> echo
> "This CPU does not support u-boot.nand target!" ; \ +
> exit 1 ;  \ + fi + 
> $(MAKE) -C $(CONFIG_NAND_TRG_PATH)
> $(obj)u-boot.nand + $(obj)u-boot.kwb:
> $(obj)u-boot.bin $(obj)tools/mkimage -n
> $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \ -a
> $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> @@ -857,6 +874,7 @@ clobber:  tidy @rm -f $(obj)u-boot.kwb
> @rm -f $(obj)u-boot.pbl @rm -f $(obj)u-boot.imx + @rm -f
> $(obj)u-boot.nand @rm -f $(obj)u-boot.ubl @rm -f
> $(obj)u-boot.ais @rm -f $(obj)u-boot.dtb diff --git
> a/arch/arm/imx-common/Makefile 
> b/arch/arm/imx-common/Makefile index 5d5c5b2..71ea36f 
> 100644 --- a/arch/arm/imx-common/Makefile +++ 
> b/arch/arm/imx-common/Makefile @@ -50,6 +50,12 @@ 
> $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin 
> $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX 
> $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T 
> imximage \ -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> 
> +$(obj)u-boot.nand: $(obj)u-boot.imx +(   
> \ + echo 
> -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ;  \
 ^ It does not work in my environment (Ubuntu 12.10). -ne is 
 interpreted as text, so the FCB is broken. This is because 
 /bin/sh (set to dash) is invoked by default on my machine 
 here. It would work with the /bin/bash set by the main 
 Makefile for SHELL, but this is not passed to the sub-make.
 
 So what do you think we should do: 1) Add "export SHELL" to 
 the main Makefile? 2) Move the SHELL assignment from the
 main Makefile to the top-level config.mk? 3) Set
 "SHELL=$(SHELL)" on the command line when invoking the
 sub-make? 4) Use printf instead of echo? 5) Something else?
 
 I like 1). Do you see possible side effects?
>>> 
>>> Wait!  We do 1 already and have for years (cf7a7b99), so
>>> what's going on?
>> 
>> Indeed! But I get anyway SHELL set to /bin/bash in /Makefile,
>> and to /bin/sh in /arch/arm/imx-common/makefile.
>> 
>> I don't see SHELL being set anywhere else, and $(MAKE) 
>> SHELL=$(SHELL) works.
>> 
>> That's really weird. It's like SHELL export was ignored, or 
>> applied before the assignment. I will further dig into this.
> 
> From "5.3.2 Choosing the Shell" in the make manual, it seems 
> impossible to force make to use SHELL from the environment, even 
> with export. The note about SHELL in "5.7.2 Communicating
> Variables to a Sub-make" can be misleading however.
> 
> Without "export SHELL", the recipes are executed with the set 
> SHELL, but the default value of SHELL is in their environment.
> 
> With "export SHELL", the recipes are executed with the set SHELL, 
> which is also in their environment. But since the sub-make ignores 
> its environment for SHELL, it does not help. That's probably why 
> Linux uses CONFIG_SHELL (which means nothing spec

Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Benoît Thébaudeau
Hi Tom,

On Thursday, February 28, 2013 4:24:22 PM, Benoît Thébaudeau wrote:
> Hi Tom,
> 
> On Thursday, February 28, 2013 3:03:09 PM, Tom Rini write:
> > On Wed, Feb 27, 2013 at 11:18:48PM +0100, Beno??t Th??baudeau wrote:
> > > Hi Marek,
> > > 
> > > On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote:
> > > > Implement u-boot.nand target that can be reused with a small amount of
> > > > churn across all CPU models. The idea is to delegate the u-boot.nand
> > > > target
> > > > out of the main Makefile and into the CPU's Makefile (very similar to
> > > > what
> > > > u-boot.imx does now). The main Makefile shall only contain path to
> > > > which
> > > > the
> > > > u-boot.nand target is delegated. Hopefully this will not produce too
> > > > much
> > > > bloat in the main Makefile.
> > > > 
> > > > To demonstrate this implementation, add u-boot.nand target for i.MX53.
> > > > 
> > > > Signed-off-by: Marek Vasut 
> > > > Cc: Beno??t Th??baudeau 
> > > > Cc: Fabio Estevam 
> > > > Cc: Stefano Babic 
> > > > ---
> > > >  Makefile |   18 ++
> > > >  arch/arm/imx-common/Makefile |6 ++
> > > >  2 files changed, 24 insertions(+)
> > > > 
> > > > diff --git a/Makefile b/Makefile
> > > > index 41054b7..8b1010a 100644
> > > > --- a/Makefile
> > > > +++ b/Makefile
> > > > @@ -470,6 +470,23 @@ $(obj)u-boot.img:  $(obj)u-boot.bin
> > > >  $(obj)u-boot.imx: $(obj)u-boot.bin depend
> > > > $(MAKE) -C $(SRCTREE)/arch/arm/imx-common 
> > > > $(obj)u-boot.imx
> > > >  
> > > > +#
> > > > +# Generic u-boot.nand target.
> > > > +#
> > > > +# Every CPU that needs u-boot.nand must add a path to an
> > > > implementation
> > > > of
> > > > +# the actual u-boot.nand generator below.
> > > > +#
> > > > +ifdef CONFIG_MX53
> > > > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common
> > > > +endif
> > > > +
> > > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend
> > > > +   if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then
> > > > \
> > > > +   echo "This CPU does not support u-boot.nand 
> > > > target!" ;  \
> > > > +   exit 1 ;
> > > > \
> > > > +   fi
> > > > +   $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand
> > > > +
> > > >  $(obj)u-boot.kwb:   $(obj)u-boot.bin
> > > > $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T 
> > > > kwbimage \
> > > > -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) 
> > > > -d $< $@
> > > > @@ -857,6 +874,7 @@ clobber:tidy
> > > > @rm -f $(obj)u-boot.kwb
> > > > @rm -f $(obj)u-boot.pbl
> > > > @rm -f $(obj)u-boot.imx
> > > > +   @rm -f $(obj)u-boot.nand
> > > > @rm -f $(obj)u-boot.ubl
> > > > @rm -f $(obj)u-boot.ais
> > > > @rm -f $(obj)u-boot.dtb
> > > > diff --git a/arch/arm/imx-common/Makefile
> > > > b/arch/arm/imx-common/Makefile
> > > > index 5d5c5b2..71ea36f 100644
> > > > --- a/arch/arm/imx-common/Makefile
> > > > +++ b/arch/arm/imx-common/Makefile
> > > > @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin
> > > > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX
> > > > $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
> > > > -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> > > >  
> > > > +$(obj)u-boot.nand: $(obj)u-boot.imx
> > > > +   (   
> > > > \
> > > > +   echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ;   
> > > > \
> > >  ^
> > > It does not work in my environment (Ubuntu 12.10). -ne is interpreted as
> > > text,
> > > so the FCB is broken. This is because /bin/sh (set to dash) is invoked by
> > > default on my machine here. It would work with the /bin/bash set by the
> > > main
> > > Makefile for SHELL, but this is not passed to the sub-make.
> > > 
> > > So what do you think we should do:
> > >  1) Add "export SHELL" to the main Makefile?
> > >  2) Move the SHELL assignment from the main Makefile to the top-level
> > >  config.mk?
> > >  3) Set "SHELL=$(SHELL)" on the command line when invoking the sub-make?
> > >  4) Use printf instead of echo?
> > >  5) Something else?
> > > 
> > > I like 1). Do you see possible side effects?
> > 
> > Wait!  We do 1 already and have for years (cf7a7b99), so what's going
> > on?
> 
> Indeed! But I get anyway SHELL set to /bin/bash in /Makefile, and to /bin/sh
> in
> /arch/arm/imx-common/makefile.
> 
> I don't see SHELL being set anywhere else, and $(MAKE) SHELL=$(SHELL) works.
> 
> That's really weird. It's like SHELL export was ignored, or applied before
> the
> assignment. I will further dig into this.

From "5.3.2 Choosing the Shell" in the make manual, it seems impossible to force
make to use SHELL from the environment, even with export. The note about SHELL
in "5.7.2 Communicating Variables to a Sub-make" can be m

Re: [U-Boot] [PATCH 1/4] common: imx: Implement generic u-boot.nand target

2013-02-28 Thread Benoît Thébaudeau
Hi Tom,

On Thursday, February 28, 2013 3:03:09 PM, Tom Rini write:
> On Wed, Feb 27, 2013 at 11:18:48PM +0100, Beno??t Th??baudeau wrote:
> > Hi Marek,
> > 
> > On Monday, February 25, 2013 7:19:54 PM, Marek Vasut wrote:
> > > Implement u-boot.nand target that can be reused with a small amount of
> > > churn across all CPU models. The idea is to delegate the u-boot.nand
> > > target
> > > out of the main Makefile and into the CPU's Makefile (very similar to
> > > what
> > > u-boot.imx does now). The main Makefile shall only contain path to which
> > > the
> > > u-boot.nand target is delegated. Hopefully this will not produce too much
> > > bloat in the main Makefile.
> > > 
> > > To demonstrate this implementation, add u-boot.nand target for i.MX53.
> > > 
> > > Signed-off-by: Marek Vasut 
> > > Cc: Beno??t Th??baudeau 
> > > Cc: Fabio Estevam 
> > > Cc: Stefano Babic 
> > > ---
> > >  Makefile |   18 ++
> > >  arch/arm/imx-common/Makefile |6 ++
> > >  2 files changed, 24 insertions(+)
> > > 
> > > diff --git a/Makefile b/Makefile
> > > index 41054b7..8b1010a 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -470,6 +470,23 @@ $(obj)u-boot.img:$(obj)u-boot.bin
> > >  $(obj)u-boot.imx: $(obj)u-boot.bin depend
> > >   $(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(obj)u-boot.imx
> > >  
> > > +#
> > > +# Generic u-boot.nand target.
> > > +#
> > > +# Every CPU that needs u-boot.nand must add a path to an implementation
> > > of
> > > +# the actual u-boot.nand generator below.
> > > +#
> > > +ifdef CONFIG_MX53
> > > +CONFIG_NAND_TRG_PATH := $(SRCTREE)/arch/arm/imx-common
> > > +endif
> > > +
> > > +$(obj)u-boot.nand: $(obj)u-boot.bin depend
> > > + if [ "X$(CONFIG_NAND_TRG_PATH)X" = "XX" ] ; then
> > > \
> > > + echo "This CPU does not support u-boot.nand target!" ;  
> > > \
> > > + exit 1 ;
> > > \
> > > + fi
> > > + $(MAKE) -C $(CONFIG_NAND_TRG_PATH) $(obj)u-boot.nand
> > > +
> > >  $(obj)u-boot.kwb:   $(obj)u-boot.bin
> > >   $(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
> > >   -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> > > @@ -857,6 +874,7 @@ clobber:  tidy
> > >   @rm -f $(obj)u-boot.kwb
> > >   @rm -f $(obj)u-boot.pbl
> > >   @rm -f $(obj)u-boot.imx
> > > + @rm -f $(obj)u-boot.nand
> > >   @rm -f $(obj)u-boot.ubl
> > >   @rm -f $(obj)u-boot.ais
> > >   @rm -f $(obj)u-boot.dtb
> > > diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile
> > > index 5d5c5b2..71ea36f 100644
> > > --- a/arch/arm/imx-common/Makefile
> > > +++ b/arch/arm/imx-common/Makefile
> > > @@ -50,6 +50,12 @@ $(obj)u-boot.imx: $(OBJTREE)/u-boot.bin
> > > $(OBJTREE)/$(patsubst "%",%,$(CONFIG_IMX
> > >   $(OBJTREE)/tools/mkimage -n $(filter-out %.bin,$^) -T imximage \
> > >   -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
> > >  
> > > +$(obj)u-boot.nand: $(obj)u-boot.imx
> > > + (   \
> > > + echo -ne '\x00\x00\x00\x00\x46\x43\x42\x20\x01' ;   \
> >  ^
> > It does not work in my environment (Ubuntu 12.10). -ne is interpreted as
> > text,
> > so the FCB is broken. This is because /bin/sh (set to dash) is invoked by
> > default on my machine here. It would work with the /bin/bash set by the
> > main
> > Makefile for SHELL, but this is not passed to the sub-make.
> > 
> > So what do you think we should do:
> >  1) Add "export SHELL" to the main Makefile?
> >  2) Move the SHELL assignment from the main Makefile to the top-level
> >  config.mk?
> >  3) Set "SHELL=$(SHELL)" on the command line when invoking the sub-make?
> >  4) Use printf instead of echo?
> >  5) Something else?
> > 
> > I like 1). Do you see possible side effects?
> 
> Wait!  We do 1 already and have for years (cf7a7b99), so what's going
> on?

Indeed! But I get anyway SHELL set to /bin/bash in /Makefile, and to /bin/sh in
/arch/arm/imx-common/makefile.

I don't see SHELL being set anywhere else, and $(MAKE) SHELL=$(SHELL) works.

That's really weird. It's like SHELL export was ignored, or applied before the
assignment. I will further dig into this.

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


Re: [U-Boot] [PATCH 0/2] ARM: mmu: Set domain permissions to client access - build warnings!

2013-02-28 Thread Albert ARIBAUD
On Thu, 28 Feb 2013 15:20:44 +0100, Albert ARIBAUD
 wrote:

> (sorry for any duplicate of this mail)
> 
> Hi R Sricharan,
> 
> On Tue, 8 Jan 2013 23:38:22 +0530, R Sricharan 
> wrote:
> 
> > Currently for ARM based cpu's, mmu pagetable attributes are set with
> > manager permissions for all 4GB address space. Because of this the
> > 'execute never (XN)' permission is never checked on read sensitive
> > regions which results in speculative aborts.
> > 
> > This series changes the domain permissions of the full 4GB space
> > to client access for OMAP socs. This avoids all the speculative
> > aborts that are currently seen on OMAP5 secure devices.
> > 
> > Tested on OMAP5 SDP (HS) soc.
> > 
> > This series depends on [1] the patch sent by 
> > 
> > 
> > [1] http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html
> > 
> > R Sricharan (2):
> >   ARM: mmu: Introduce weak dram_bank_setup function
> >   ARM: mmu: Set domain permissions to client access
> > 
> >  arch/arm/cpu/armv7/cache_v7.c  |3 ++
> >  arch/arm/cpu/armv7/omap-common/hwinit-common.c |   35 
> > 
> >  arch/arm/include/asm/cache.h   |1 +
> >  arch/arm/include/asm/system.h  |   14 ++
> >  arch/arm/lib/cache-cp15.c  |   13 -
> >  5 files changed, 65 insertions(+), 1 deletion(-)
> > 
> 
> Series applied to u-boot-arm/master, thanks!

Correction: I'd wrongly inferred from the testing done on OMAP5 that
the series would build fine. However it appears that for targets
omap4_sdp4430, omap4_panda and omap5_evm, patch 2/2 has warnings:

hwinit-common.c: In function 'dram_bank_mmu_setup':
hwinit-common.c:279:3: warning: implicit declaration of function
'set_section_dcache' [-Wimplicit-function-declaration]

Luckily, I had not committed to the git repo yet.

R Sicharan, can you please check and fix this warning?

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


Re: [U-Boot] [PATCH] mxs: timrot: Rename local macros

2013-02-28 Thread Otavio Salvador
On Thu, Feb 28, 2013 at 12:03 PM, Fadil Berisha  wrote:
> From: Fadil Berisha 
>
> Local macros apply to both iMX23 and iMX28. This patch renames local
> macros with attribute MX28 to MXS.
>
> Signed-off-by: Fadil Berisha 

Acked-by: Otavio Salvador 



-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] mxs: timrot: Rename local macros

2013-02-28 Thread Fadil Berisha
From: Fadil Berisha 

Local macros apply to both iMX23 and iMX28. This patch renames local
macros with attribute MX28 to MXS.

Signed-off-by: Fadil Berisha 
Cc: Marek Vasut 
Cc: Otavio Salvador 
Cc: Fabio Estevam 
Cc: Stefano Babic 
---
 arch/arm/cpu/arm926ejs/mxs/timer.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mxs/timer.c 
b/arch/arm/cpu/arm926ejs/mxs/timer.c
index fc0a2af..61da0ca 100644
--- a/arch/arm/cpu/arm926ejs/mxs/timer.c
+++ b/arch/arm/cpu/arm926ejs/mxs/timer.c
@@ -46,22 +46,22 @@ DECLARE_GLOBAL_DATA_PTR;
 /*
  * This driver uses 1kHz clock source.
  */
-#defineMX28_INCREMENTER_HZ 1000
+#defineMXS_INCREMENTER_HZ  1000
 
 static inline unsigned long tick_to_time(unsigned long tick)
 {
-   return tick / (MX28_INCREMENTER_HZ / CONFIG_SYS_HZ);
+   return tick / (MXS_INCREMENTER_HZ / CONFIG_SYS_HZ);
 }
 
 static inline unsigned long time_to_tick(unsigned long time)
 {
-   return time * (MX28_INCREMENTER_HZ / CONFIG_SYS_HZ);
+   return time * (MXS_INCREMENTER_HZ / CONFIG_SYS_HZ);
 }
 
 /* Calculate how many ticks happen in "us" microseconds */
 static inline unsigned long us_to_tick(unsigned long us)
 {
-   return (us * MX28_INCREMENTER_HZ) / 100;
+   return (us * MXS_INCREMENTER_HZ) / 100;
 }
 
 int timer_init(void)
@@ -136,17 +136,17 @@ ulong get_timer(ulong base)
 }
 
 /* We use the HW_DIGCTL_MICROSECONDS register for sub-millisecond timer. */
-#defineMX28_HW_DIGCTL_MICROSECONDS 0x8001c0c0
+#defineMXS_HW_DIGCTL_MICROSECONDS  0x8001c0c0
 
 void __udelay(unsigned long usec)
 {
uint32_t old, new, incr;
uint32_t counter = 0;
 
-   old = readl(MX28_HW_DIGCTL_MICROSECONDS);
+   old = readl(MXS_HW_DIGCTL_MICROSECONDS);
 
while (counter < usec) {
-   new = readl(MX28_HW_DIGCTL_MICROSECONDS);
+   new = readl(MXS_HW_DIGCTL_MICROSECONDS);
 
/* Check if the timer wrapped. */
if (new < old) {
@@ -171,5 +171,5 @@ void __udelay(unsigned long usec)
 
 ulong get_tbclk(void)
 {
-   return MX28_INCREMENTER_HZ;
+   return MXS_INCREMENTER_HZ;
 }
-- 
1.7.10

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


Re: [U-Boot] [PATCH] dts/Makefile: Build the user specified dts

2013-02-28 Thread Jagannadha Sutradharudu Teki
Hi Simon,

> -Original Message-
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: 28 February 2013 20:08
> To: Jagannadha Sutradharudu Teki
> Cc: u-boot@lists.denx.de; Jerry Van Baren; mon...@monstr.eu; Jagannadha
> Sutradharudu Teki; Vadim Bendebury
> Subject: Re: [PATCH] dts/Makefile: Build the user specified dts
>
> Hi Jagannadha,
>
> On Thu, Feb 28, 2013 at 6:33 AM, Jagannadha Sutradharudu Teki
>  wrote:
> > This patch provides a support to build the user specified dts.
> > If the user is not specifying any dts, then it should build the dts
> > from CONFIG_DEFAULT_DEVICE_TREE.
> >
> > $ make -> choose the default dts, defined as
> > CONFIG_DEFAULT_DEVICE_TREE $ make DEVICE_TREE= ->
> > choose the specified dts from the user
> >
> > Signed-off-by: Jagannadha Sutradharudu Teki 
>
> This is a useful patch thank you.
>
> > ---
> >  dts/Makefile |2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/dts/Makefile b/dts/Makefile index 922c78c..dd6c1fa 100644
> > --- a/dts/Makefile
> > +++ b/dts/Makefile
> > @@ -29,7 +29,9 @@ LIB   = $(obj)libdts.o
> >
> >  $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\  $(error Please define
> > CONFIG_DEFAULT_DEVICE_TREE in your board header file))
> > +ifneq ($(DEVICE_TREE),y)
> >  DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
> > +endif
>
> It would be better if we could not give an error if DEVICE_TREE is defined,
> even if there is no CONFIG_DEFAULT_DEVICE_TREE.

For backward compatibility, as most of the users are defined 
CONFIG_DEFAULT_DEVICE_TREE
on their board configs ie the reason I have proceeded this way.

May be I will send the v2 as you suggested., is that fine?
Please comment.

Thanks,
Jagan.

>
> >
> >  $(if $(CONFIG_ARCH_DEVICE_TREE),,\
> >  $(error Your architecture does not have device tree support enabled.
> > \
> > --
> > 1.7.4
> >
> >
>
> Regards,
> Simon



This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.


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


Re: [U-Boot] [PATCH 2/2] ARM: tegra: make CONFIG_CMD_PART common

2013-02-28 Thread Lucas Stach
Am Mittwoch, den 27.02.2013, 14:03 -0700 schrieb Stephen Warren:
> On 02/26/2013 04:00 PM, Stephen Warren wrote:
> > This is useful on all Tegras, so that boot.scr on all devices can use
> > the same commands. Hence, move it to tegra-common.h.
> 
> Unfortunately, this breaks Tegra114 builds because no partition types
> are enabled, and CONFIG_CMD_PART requires functionality that's only
> enabled if some partition types are supported.
> 
> There are two possible solutions:
> 
> 1) Conditionally enable PARTITION_UUIDS and CMD_PART in
> tegra-common-post.h only if some partition type is enabled.
> 
> 2) Also enable DOS and EFI partitions in tegra-common.h, along with all
> of FS_EXT4, FS_FAT, CMD_EXT2, CMD_FAT, CMD_FS_GENERIC. For most boards
> this won't be any change. For the Colibri T20 and Avionic Design boards,
> this ends up enabling a few more options.
> 
> (or perhaps enable all of those in tegra-common-post.h only if support
> for any block device is enabled)
> 
> I prefer option (2). Does anyone object?
> 
No objections. There is no real reason to leave out all those options as
we are not size limited on the Colibri.

Regards,
Lucas

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


Re: [U-Boot] [PATCH] dts/Makefile: Build the user specified dts

2013-02-28 Thread Simon Glass
Hi Jagannadha,

On Thu, Feb 28, 2013 at 6:33 AM, Jagannadha Sutradharudu Teki
 wrote:
> This patch provides a support to build the user specified dts.
> If the user is not specifying any dts, then it should build the
> dts from CONFIG_DEFAULT_DEVICE_TREE.
>
> $ make -> choose the default dts, defined as CONFIG_DEFAULT_DEVICE_TREE
> $ make DEVICE_TREE= -> choose the specified dts from the user
>
> Signed-off-by: Jagannadha Sutradharudu Teki 

This is a useful patch thank you.

> ---
>  dts/Makefile |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/dts/Makefile b/dts/Makefile
> index 922c78c..dd6c1fa 100644
> --- a/dts/Makefile
> +++ b/dts/Makefile
> @@ -29,7 +29,9 @@ LIB   = $(obj)libdts.o
>
>  $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
>  $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file))
> +ifneq ($(DEVICE_TREE),y)
>  DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
> +endif

It would be better if we could not give an error if DEVICE_TREE is
defined, even if there is no CONFIG_DEFAULT_DEVICE_TREE.

>
>  $(if $(CONFIG_ARCH_DEVICE_TREE),,\
>  $(error Your architecture does not have device tree support enabled. \
> --
> 1.7.4
>
>

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


[U-Boot] [PATCH] dts/Makefile: Build the user specified dts

2013-02-28 Thread Jagannadha Sutradharudu Teki
This patch provides a support to build the user specified dts.
If the user is not specifying any dts, then it should build the
dts from CONFIG_DEFAULT_DEVICE_TREE.

$ make -> choose the default dts, defined as CONFIG_DEFAULT_DEVICE_TREE
$ make DEVICE_TREE= -> choose the specified dts from the user

Signed-off-by: Jagannadha Sutradharudu Teki 
---
 dts/Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index 922c78c..dd6c1fa 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -29,7 +29,9 @@ LIB   = $(obj)libdts.o
 
 $(if $(CONFIG_DEFAULT_DEVICE_TREE),,\
 $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your board header file))
+ifneq ($(DEVICE_TREE),y)
 DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
+endif
 
 $(if $(CONFIG_ARCH_DEVICE_TREE),,\
 $(error Your architecture does not have device tree support enabled. \
-- 
1.7.4


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


Re: [U-Boot] [PATCH] I2C: S3C24X0: Remove the dead code

2013-02-28 Thread Simon Glass
On Mon, Feb 18, 2013 at 9:58 PM, Rajeshwari Shinde
 wrote:
> This revomes the code under #if 0 in the s3c24x0_i2c driver.
>
> Signed-off-by: Alim Akhtar 
> Signed-off-by: Rajeshwari Shinde 

Acked-by: Simon Glass 

> ---
>  drivers/i2c/s3c24x0_i2c.c |7 ---
>  1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
> index 769a2ba..00308b5 100644
> --- a/drivers/i2c/s3c24x0_i2c.c
> +++ b/drivers/i2c/s3c24x0_i2c.c
> @@ -86,13 +86,6 @@ static int GetI2CSDA(void)
>  #endif
>  }
>
> -#if 0
> -static void SetI2CSDA(int x)
> -{
> -   rGPEDAT = (rGPEDAT & ~0x8000) | (x & 1) << 15;
> -}
> -#endif
> -
>  static void SetI2CSCL(int x)
>  {
> struct s3c24x0_gpio *gpio = s3c24x0_get_base_gpio();
> --
> 1.7.4.4
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] problem to boot i.MX28 custom platform

2013-02-28 Thread Fabio Estevam
Hi Hector,

Hector Palacios wrote:

> Apparently the problem was due to my platform suffering a hardware
> specific VDDD brownout during the initialization.
> 
> Just in case it helps anybody, the reason why I was not able to see
> anything on the DUART port during SPL initialization, despite having
> enabled CONFIG_SPL_SERIAL_SUPPORT and having serial_puts() on the SPL
> code, was that my platform uses alternate pins for the DUART than the
> default used by the BOOT ROM and the EVK, so apart from configuring the
> correct IOMUX, I needed to unconfigure the pins used by BOOT ROM for the
> DUART (on board//iomux.c):
> 
> @@ -33,8 +33,12 @@
> 
>  const iomux_cfg_t iomux_setup[] = {
> /* DUART */
> -   MX28_PAD_PWM0__DUART_RX,
> -   MX28_PAD_PWM1__DUART_TX,
> +   /* Unconfigure BOOT ROM default DUART */
> +   MX28_PAD_PWM0__GPIO_3_16,
> +   MX28_PAD_PWM1__GPIO_3_17,
> +   /* Configure DUART on alternate pins */
> +   MX28_PAD_I2C0_SCL__DUART_RX,
> +   MX28_PAD_I2C0_SDA__DUART_TX,
> 
> /* MMC0 */
> MX28_PAD_SSP0_DATA0__SSP0_D0 | MUX_CONFIG_SSP0,
> @@ -159,9 +163,6 @@ const iomux_cfg_t iomux_setup[] = {
> MX28_PAD_SSP2_MISO__SSP2_D0 | MUX_CONFIG_SSP2,
> MX28_PAD_SSP2_SS0__SSP2_D3 |
> (MXS_PAD_3V3 | MXS_PAD_8MA | MXS_PAD_PULLUP),
> -   /* I2C */
> -   MX28_PAD_I2C0_SCL__I2C0_SCL,
> -   MX28_PAD_I2C0_SDA__I2C0_SDA,
>  };
> 
>  #define HW_DRAM_CTL29  (0x74 >> 2)

Thanks for sharing your solution. It seems that the other mx28 boards we 
currently have all use
MX28_PAD_PWM0__DUART_RX / MX28_PAD_PWM1__DUART_TX for DUART and then we never 
faced this issue.

It would be great if you can submit a patch for adding support to your board in 
U-boot.

Regards,

Fabio Estevam



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


Re: [U-Boot] [PATCH 0/2] ARM: mmu: Set domain permissions to client access

2013-02-28 Thread Albert ARIBAUD
(sorry for any duplicate of this mail)

Hi R Sricharan,

On Tue, 8 Jan 2013 23:38:22 +0530, R Sricharan 
wrote:

> Currently for ARM based cpu's, mmu pagetable attributes are set with
> manager permissions for all 4GB address space. Because of this the
> 'execute never (XN)' permission is never checked on read sensitive
> regions which results in speculative aborts.
> 
> This series changes the domain permissions of the full 4GB space
> to client access for OMAP socs. This avoids all the speculative
> aborts that are currently seen on OMAP5 secure devices.
> 
> Tested on OMAP5 SDP (HS) soc.
> 
> This series depends on [1] the patch sent by 
> 
> 
> [1] http://www.mail-archive.com/u-boot@lists.denx.de/msg102709.html
> 
> R Sricharan (2):
>   ARM: mmu: Introduce weak dram_bank_setup function
>   ARM: mmu: Set domain permissions to client access
> 
>  arch/arm/cpu/armv7/cache_v7.c  |3 ++
>  arch/arm/cpu/armv7/omap-common/hwinit-common.c |   35 
> 
>  arch/arm/include/asm/cache.h   |1 +
>  arch/arm/include/asm/system.h  |   14 ++
>  arch/arm/lib/cache-cp15.c  |   13 -
>  5 files changed, 65 insertions(+), 1 deletion(-)
> 

Series 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


  1   2   >