Re: [U-Boot] [U-Boot,v3,7/8] usb: hub: Reset only usb 2.0 ports

2013-04-24 Thread Vivek Gautam
On Wed, Apr 24, 2013 at 5:51 AM, Marek Vasut ma...@denx.de wrote:
 Dear Julius Werner,

 Sorry, forgot this one yesterday. I would consider to just drop/revert
 this patch entirely. It's not wrong, but it adds complexity where it is
 not needed. You don't have to reset SuperSpeed devices, but it shouldn't
 hurt either and from what I can tell Linux does it as well.

 Ok, I can drop this one.

Alright, we will drop this.
I think a possible bug related to calling xhci_port_state_to_neutral()
in xhci_submit_root()
(one pointed by Julius in [PATCH v3 3/8] usb: hub: Power-cycle on
root-hub ports) was causing
USB 3.0 protocol ports fail while resetting.
Now things are fine.


  As per XHCI specifications USB 3.0 protocol ports attempt
  to advance to 'Enabled' state; however USB 2.0 protocol ports
  require software reset to advance them to 'Enabled' state.
  Thereby, inferring that software need to reset USB 2.0 protocol
  ports invariably (as per EHCI spec or xHCI spec).
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 
  ---
  This patch added in V3(current-version) of this patch-series.
 
   common/usb_hub.c |   23 +++
   1 files changed, 19 insertions(+), 4 deletions(-)
 
  diff --git a/common/usb_hub.c b/common/usb_hub.c
  index 1e225e6..eedbcf2 100644
  --- a/common/usb_hub.c
  +++ b/common/usb_hub.c
  @@ -233,6 +233,7 @@ void usb_hub_port_connect_change(struct usb_device
  *dev, int port)
 
  struct usb_device *usb;
  ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
  unsigned short portstatus;
 
  +   uint32_t do_port_reset = 1;
 
  /* Check status */
  if (usb_get_port_status(dev, port + 1, portsts)  0) {
 
  @@ -246,6 +247,9 @@ void usb_hub_port_connect_change(struct usb_device
  *dev, int port)
 
le16_to_cpu(portsts-wPortChange),
portspeed(portstatus));
 
  +   if (portstatus  (1  USB_PORT_FEAT_SUPERSPEED))
  +   do_port_reset = 0;
  +
 
  /* Clear the connection change status */
  usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION);
 
  @@ -259,10 +263,21 @@ void usb_hub_port_connect_change(struct usb_device
  *dev, int port)
 
  }
  mdelay(200);
 
  -   /* Reset the port */
  -   if (hub_port_reset(dev, port, portstatus)  0) {
  -   printf(cannot reset port %i!?\n, port + 1);
  -   return;
  +   /*
  +* Reset the port:
  +* As per xHCI protocol, USB 3.0 devices do not require
  +* a port reset, however USB 2.0 device do require the same
  +* to let ports proceed to 'enabled' state
  +*
  +* XXX: Will this break EHCI ??
  +* probably not, above condition for 'do_port_reset' checks for
  +* speed, and for EHCI it can't reach Super speed anyways.
  +*/
  +   if (do_port_reset) {
  +   if (hub_port_reset(dev, port, portstatus)  0) {
  +   printf(cannot reset port %i!?\n, port + 1);
  +   return;
  +   }
 
  }
 
  mdelay(200);

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



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


Re: [U-Boot] [PATCH] usb: common: Use a global definition for 'min3'

2013-04-24 Thread Vivek Gautam
On Mon, Apr 22, 2013 at 7:15 PM, Tom Rini tr...@ti.com wrote:
 On Fri, Apr 19, 2013 at 01:29:12PM +0200, Marek Vasut wrote:
 Dear Vivek Gautam,

  We can use a common global method for calculating minimum of
  3 numbers. Put the same in 'common header' and let 'ehci'
  use it.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

 Applied, thanks

 NAK, sorry.  Lets re-sync with the kernel's min/max/min3/max3 defines
 here instead.

Alright, i shall sync the definitions with Linux kernel and send the
patch for same.




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


Re: [U-Boot] [PATCH] usb: common: Use a global definition for 'min3'

2013-04-24 Thread Vivek Gautam
Hi Marek,


On Wed, Apr 24, 2013 at 11:49 AM, Vivek Gautam
gautamvivek1...@gmail.com wrote:
 On Mon, Apr 22, 2013 at 7:15 PM, Tom Rini tr...@ti.com wrote:
 On Fri, Apr 19, 2013 at 01:29:12PM +0200, Marek Vasut wrote:
 Dear Vivek Gautam,

  We can use a common global method for calculating minimum of
  3 numbers. Put the same in 'common header' and let 'ehci'
  use it.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

 Applied, thanks

 NAK, sorry.  Lets re-sync with the kernel's min/max/min3/max3 defines
 here instead.

 Alright, i shall sync the definitions with Linux kernel and send the
 patch for same.

Will you be dropping this patch from u-boot-usb/next or shall i send a
subsequent patch on
top of this ?


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


[U-Boot] [PATCH] git-mailrc: Add trini shortcut

2013-04-24 Thread Michal Simek
Easier for using with patman.

Signed-off-by: Michal Simek michal.si...@xilinx.com
---
 doc/git-mailrc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/git-mailrc b/doc/git-mailrc
index 0f23776..e3a47c4 100644
--- a/doc/git-mailrc
+++ b/doc/git-mailrc
@@ -34,6 +34,7 @@ alias sjgSimon Glass s...@chromium.org
 alias smcnuttScott McNutt smcn...@psyent.com
 alias sonic  Sonic Zhang sonic@gmail.com
 alias stroeseStefan Roese s...@denx.de
+alias trini  Tom Rini tr...@ti.com
 alias vapier Mike Frysinger vap...@gentoo.org
 alias wd Wolfgang Denk w...@denx.de

@@ -54,7 +55,7 @@ alias s5pc   samsung
 alias samsunguboot, prom
 alias tegra  uboot, sjg, Tom Warren twar...@nvidia.com, Stephen 
Warren swar...@nvidia.com
 alias tegra2 tegra
-alias ti uboot, Tom Rini tr...@ti.com
+alias ti uboot, trini

 alias avr32  uboot, abiessmann

--
1.8.2.1



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


Re: [U-Boot] [PATCH V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Stefano Babic
On 21/04/2013 22:29, Marek Vasut wrote:
 Dear Benoît Thébaudeau,
 
 Dear Marek Vasut,


Hi Marek,

 On Sunday, April 21, 2013 9:12:31 PM, Marek Vasut wrote:
 Dear Benoît Thébaudeau,

 Dear Marek Vasut,

 On Sunday, April 21, 2013 5:52:27 PM, Marek Vasut wrote:
 Add basic support for the DENX M53EVK board. Currently supported is:
 MMC (incl. booting)

  ^

 Can you clarify this, please?

 Use u-boot.imx for SD booting as usual.

 spl_boot_device() points only to NAND, so
 you're clearly talking about hardware MMC boot, and not about hardware
 NAND boot followed by SPL payload fetched from MMC. But MMC boot does
 not need SPL here, in which case you will have to generate a simple
 u-boot.imx, or you will rather want to use u-boot-with-spl.imx for SD
 (NAND header dropped to leave room for MBR). And in the latter case,
 why have spl_boot_device() point to NAND for MMC boot?

 No, regular u-boot.imx will be used for SD boot.

 OK. So this will require to call make with u-boot.imx as the explicit
 target. Should this be documented somewhere, perhaps in a README file for
 this board?

 Another solution would be, like for woodburn, to have an sd-specific
 config: - m53evk_nand_config would define CONFIG_SPL from boards.cfg, so
u-boot-with-nand-spl.imx would be generated.
  - mx53evk_sd_config would not define CONFIG_SPL from boards.cfg, so
 u-boot.imx would be generated.
 And CONFIG_SPL would be removed from m53evk.h.

 Or, change the various config.mk in order to build u-boot.imx even if
 CONFIG_SPL is defined, which would be useless for some boards, but useful
 here in order to avoid having 2 configs for almost the same build, while
 still not having to explicitly give a make target.
 
 I'd love to see generic u-boot.nand , u-boot.sd etc. targets instead of these 
 CPU specific stuffs.
 

But you forget that a single image can be saved on multiple storage:
u-boot.imx can be stored on SD or NOR or SPI-NOR, and that is the reason
for having SOC-specific extension.

I agree with Benoit: at the moment, only people working with i.MX know
that u-boot.im runs on SD. The third solution proposed by Benoit has the
drawback that probably not all boards need u-boot.imx (a board without
SD for example). At least we need an update of the README, but I think
it is not bad to have a new entry in boards.cfg.

Apart of that and not related to this patch, if we in future use SPL
also for booting from SD, we can get a single way to boot from different
storage. TI based SOCs already do this: same SPL, it checks from SD and
NAND.

Best regards,
Stefano

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


[U-Boot] patman and buildman experience

2013-04-24 Thread Michal Simek
Hi guys,

yesterday I was talking to Simon on IRC about these two tools.
Also it was the first day I have tried these tools.

Simon asked me to share my experience with these tools with you
and try to suggest improvement in it.

First of all just let me say that I don't know python at all
but maybe good time to look at it.


1. Let's start with last thing I have met with.

Tom has gave me Reviewed-by for the whole my zynq series but
I didn't found any option for patman to support this.
It is not rare case and it should be IMHO supported.

I past I was using git alias for that

rtrini = filter-branch -f --msg-filter '\
cat  \
echo Reviewed-by: Tom Rini \\tr...@ti.com\\\
'

by calling git rtrini wd/master..HEAD all patches
contained that line.
With patman this options is not possible to use because
at the end of emails are Series-changes.

NOTE: have sent shortcut for adding Tom's shortcut to git-mailrc

I see two ways how to fix it.
1. Support END for version changes
2. Add new Series-ack, Series-re, support to patman


2. The next minor thing which could be extend is default CC your colleagues
in ~/.patman. I know it is just one line in commit message but
why not to have this in default config.


3. Also will be good to list all options which can be added to ~/.patman
with description what that options means.


4. Then I still have a problem with buildman with missing total_seconds support

[u-boot]$ ./tools/buildman/buildman -b zynq zynq
Building 16 commits for 2 boards (2 threads, 2 jobs per thread)
Traceback (most recent call last):
  File ./tools/buildman/buildman, line 126, in module
control.DoBuildman(options, args)
  File /mnt/projects/u-boot/tools/buildman/control.py, line 181, in DoBuildman
options.show_errors, options.keep_outputs)
  File /mnt/projects/u-boot/tools/buildman/builder.py, line 1428, in 
BuildBoards
self.ProcessResult(None)
  File /mnt/projects/u-boot/tools/buildman/builder.py, line 724, in 
ProcessResult
self._AddTimestamp()
  File /mnt/projects/u-boot/tools/buildman/builder.py, line 632, in 
_AddTimestamp
seconds = delta.total_seconds()
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'
[u-boot]$ python --version
Python 2.7.4

I have found that it is new feature in python 2.7.4

http://docs.python.org/2/library/datetime.html#datetime.timedelta

I have also confirmed that total_seconds is working based on example on that 
page.

[u-boot]$ python
Python 2.7.4 (default, Apr 23 2013, 13:20:21)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 from datetime import timedelta
 year = timedelta(days=365)
 another_year = timedelta(weeks=40, days=84, hours=23, minutes=50, 
 seconds=600)
 year.total_seconds()
31536000.0


Can you see what's wrong?

Currently I have solved this by:

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index e426442..2d72243 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -629,7 +629,7 @@ class Builder:
 self._timestamps.append(now)
 count = len(self._timestamps)
 delta = self._timestamps[-1] - self._timestamps[0]
-seconds = delta.total_seconds()
+seconds = 1 # delta.total_seconds()

 # If we have enough data, estimate build period (time taken for a
 # single build) and therefore completion time.



5. Buildman always add git clones to ../branch_name location.
I would welcome to be able to setup on ~/.buildman default location for these 
folders.
Mostly /tmp folder or location on SSD.


Anyway thanks Simon for these great tools.
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP - KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


[U-Boot] [PATCH 0/3] net: macb: add support for gigabit MAC

2013-04-24 Thread Bo Shen
This patch add macb support for gigabit MAC, will be used by sama5d3.
Tha patch for sama5d3 is in patchwork:
  http://patchwork.ozlabs.org/patch/226795/

After this patch is applied, will add gmac support for sama5d3

Bo Shen (3):
  net: macb: using AT91FAMILY replace #ifdeferry
  net: macb: using phylib to configure phy device
  net: macb: add support for gigabit MAC

 drivers/net/macb.c |  177 +++-
 drivers/net/macb.h |   55 ++--
 2 files changed, 184 insertions(+), 48 deletions(-)

-- 
1.7.9.5

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


[U-Boot] [PATCH 2/3] net: macb: using phylib to configure phy device

2013-04-24 Thread Bo Shen
using phylib to configure phy device in macb driver

Signed-off-by: Bo Shen voice.s...@atmel.com
---
 drivers/net/macb.c |   16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 753fb96..b83d65a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -103,6 +103,7 @@ struct macb_device {
const struct device *dev;
struct eth_device   netdev;
unsigned short  phy_addr;
+   struct mii_dev  *bus;
 };
 #define to_macb(_nd) container_of(_nd, struct macb_device, netdev)
 
@@ -163,7 +164,7 @@ static u16 macb_mdio_read(struct macb_device *macb, u8 reg)
return MACB_BFEXT(DATA, frame);
 }
 
-#if defined(CONFIG_CMD_MII)
+#if defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
 
 int macb_miiphy_read(const char *devname, u8 phy_adr, u8 reg, u16 *value)
 {
@@ -372,6 +373,9 @@ static int macb_phy_find(struct macb_device *macb)
 static int macb_phy_init(struct macb_device *macb)
 {
struct eth_device *netdev = macb-netdev;
+#ifdef CONFIG_PHYLIB
+   struct phy_device *phydev;
+#endif
u32 ncfgr;
u16 phy_id, status, adv, lpa;
int media, speed, duplex;
@@ -391,6 +395,13 @@ static int macb_phy_init(struct macb_device *macb)
return 0;
}
 
+#ifdef CONFIG_PHYLIB
+   phydev-bus = macb-bus;
+   phydev-dev = netdev;
+   phydev-addr = macb-phy_addr;
+   phy_config(phydev);
+#endif
+
status = macb_mdio_read(macb, MII_BMSR);
if (!(status  BMSR_LSTATUS)) {
/* Try to re-negotiate if we don't have link already. */
@@ -574,8 +585,9 @@ int macb_eth_initialize(int id, void *regs, unsigned int 
phy_addr)
 
eth_register(netdev);
 
-#if defined(CONFIG_CMD_MII)
+#if defined(CONFIG_CMD_MII) || defined(CONFIG_PHYLIB)
miiphy_register(netdev-name, macb_miiphy_read, macb_miiphy_write);
+   macb-bus = miiphy_get_dev_by_name(netdev-name);
 #endif
return 0;
 }
-- 
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/3] net: macb: using AT91FAMILY replace #ifdeferry

2013-04-24 Thread Bo Shen
Using CONFIG_AT91FAMILY replace #ifdeferry for atmel SoC

Signed-off-by: Bo Shen voice.s...@atmel.com
---
 drivers/net/macb.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 8bacbda..753fb96 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -466,19 +466,13 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
-#ifdefined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-   defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-   defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-   defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
+#ifdef CONFIG_AT91FAMILY
macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
 #else
macb_writel(macb, USRIO, 0);
 #endif
 #else
-#ifdefined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
-   defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
-   defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-   defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
+#ifdef CONFIG_AT91FAMILY
macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
macb_writel(macb, USRIO, MACB_BIT(MII));
-- 
1.7.9.5

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


[U-Boot] [PATCH 3/3] net: macb: add support for gigabit MAC

2013-04-24 Thread Bo Shen
Add gigabit MAC support in macb driver
  - using IP version to distinguish whether MAC is GMAC

Signed-off-by: Bo Shen voice.s...@atmel.com
---
 drivers/net/macb.c |  151 +---
 drivers/net/macb.h |   55 ---
 2 files changed, 168 insertions(+), 38 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index b83d65a..e4e2a74 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -107,6 +107,11 @@ struct macb_device {
 };
 #define to_macb(_nd) container_of(_nd, struct macb_device, netdev)
 
+static int macb_is_gem(struct macb_device *macb)
+{
+   return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2;
+}
+
 static void macb_mdio_write(struct macb_device *macb, u8 reg, u16 value)
 {
unsigned long netctl;
@@ -419,28 +424,64 @@ static int macb_phy_init(struct macb_device *macb)
printf(%s: link down (status: 0x%04x)\n,
   netdev-name, status);
return 0;
-   } else {
-   adv = macb_mdio_read(macb, MII_ADVERTISE);
-   lpa = macb_mdio_read(macb, MII_LPA);
-   media = mii_nway_result(lpa  adv);
-   speed = (media  (ADVERTISE_100FULL | ADVERTISE_100HALF)
-? 1 : 0);
-   duplex = (media  ADVERTISE_FULL) ? 1 : 0;
-   printf(%s: link up, %sMbps %s-duplex (lpa: 0x%04x)\n,
-  netdev-name,
-  speed ? 100 : 10,
-  duplex ? full : half,
-  lpa);
-
-   ncfgr = macb_readl(macb, NCFGR);
-   ncfgr = ~(MACB_BIT(SPD) | MACB_BIT(FD));
-   if (speed)
-   ncfgr |= MACB_BIT(SPD);
-   if (duplex)
-   ncfgr |= MACB_BIT(FD);
-   macb_writel(macb, NCFGR, ncfgr);
-   return 1;
}
+
+   /* First check for GMAC */
+   if (macb_is_gem(macb)) {
+   lpa = macb_mdio_read(macb, MII_STAT1000);
+   if (lpa  (1  11)) {
+   speed = 1000;
+   duplex = 1;
+   } else {
+  if (lpa  (1  10)) {
+   speed = 1000;
+   duplex = 1;
+   } else {
+   speed = 0;
+   }
+   }
+
+   if (speed == 1000) {
+   printf(%s: link up, %dMbps %s-duplex (lpa: 0x%04x)\n,
+  netdev-name,
+  speed,
+  duplex ? full : half,
+  lpa);
+
+   ncfgr = macb_readl(macb, NCFGR);
+   ncfgr = ~(GEM_BIT(GBE) | MACB_BIT(SPD) | MACB_BIT(FD));
+   if (speed)
+   ncfgr |= GEM_BIT(GBE);
+   if (duplex)
+   ncfgr |= MACB_BIT(FD);
+   macb_writel(macb, NCFGR, ncfgr);
+
+   return 1;
+   }
+   }
+
+   /* fall back for EMAC checking */
+   adv = macb_mdio_read(macb, MII_ADVERTISE);
+   lpa = macb_mdio_read(macb, MII_LPA);
+   media = mii_nway_result(lpa  adv);
+   speed = (media  (ADVERTISE_100FULL | ADVERTISE_100HALF)
+? 1 : 0);
+   duplex = (media  ADVERTISE_FULL) ? 1 : 0;
+   printf(%s: link up, %sMbps %s-duplex (lpa: 0x%04x)\n,
+  netdev-name,
+  speed ? 100 : 10,
+  duplex ? full : half,
+  lpa);
+
+   ncfgr = macb_readl(macb, NCFGR);
+   ncfgr = ~(MACB_BIT(SPD) | MACB_BIT(FD));
+   if (speed)
+   ncfgr |= MACB_BIT(SPD);
+   if (duplex)
+   ncfgr |= MACB_BIT(FD);
+   macb_writel(macb, NCFGR, ncfgr);
+
+   return 1;
 }
 
 static int macb_init(struct eth_device *netdev, bd_t *bd)
@@ -475,6 +516,13 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
macb_writel(macb, RBQP, macb-rx_ring_dma);
macb_writel(macb, TBQP, macb-tx_ring_dma);
 
+   if (macb_is_gem(macb)) {
+#ifdef CONFIG_RGMII
+   gem_writel(macb, UR, GEM_BIT(RGMII));
+#else
+   gem_writel(macb, UR, 0);
+#endif
+   } else {
/* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
 #ifdef CONFIG_AT91FAMILY
@@ -489,6 +537,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
macb_writel(macb, USRIO, MACB_BIT(MII));
 #endif
 #endif /* CONFIG_RMII */
+   }
 
if (!macb_phy_init(macb))
return -1;
@@ -532,11 +581,48 @@ static int macb_write_hwaddr(struct eth_device *dev)
return 0;
 }
 
+static u32 macb_mdc_clk_div(int id, struct macb_device *macb)
+{
+   u32 config;
+   unsigned long macb_hz = get_macb_pclk_rate(id);
+
+   if (macb_hz  2000)
+   

[U-Boot] [RFC PATCH 0/1] GPIO support for Microblaze

2013-04-24 Thread Michal Simek
I want to also write gpio support for Zynq
and this driver should be also used for arm zynq.

Currently we have support just for only gpio controller
but not for various of them.
That's why I would like to get some input from you
if possible to add dynamic gpio allocation which
could be also helpful for OF support.

Output from my gpio status on Microblaze is below.

Thanks,
Michal

U-Boot gpio status

gpio_info: reset/4000 (0-0)
GPIO_0: reset_pin is an INPUT value = 0

gpio_info: led/4004 (1-5)
GPIO_1: UNKNOWN is an INPUT value = 0
GPIO_2: UNKNOWN is an OUTPUT value = 1
GPIO_3: UNKNOWN is an INPUT value = 0
GPIO_4: UNKNOWN is an INPUT value = 0
GPIO_5: UNKNOWN is an OUTPUT value = 0


Michal Simek (1):
  gpio: Add support for microblaze xilinx GPIO

 arch/microblaze/include/asm/gpio.h |  50 +---
 .../xilinx/microblaze-generic/microblaze-generic.c |  17 +-
 drivers/gpio/Makefile  |   1 +
 drivers/gpio/xilinx_gpio.c | 323 +
 include/configs/microblaze-generic.h   |   3 +-
 5 files changed, 353 insertions(+), 41 deletions(-)
 create mode 100644 drivers/gpio/xilinx_gpio.c

--
1.8.2.1



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


[U-Boot] [RFC PATCH] gpio: Add support for microblaze xilinx GPIO

2013-04-24 Thread Michal Simek
Microblaze uses gpio which is connected to the system reset.
Currently gpio subsystem wasn't used for it.

Add gpio driver and change Microblaze reset logic to be done
via gpio subsystem.

There are various configurations which Microblaze can have
that's why gpio_alloc/gpio_alloc_dual(for dual channel)
function has been introduced and gpio can be allocated
dynamically.

Adding several gpios IP is also possible and supported.

For listing gpio configuration please use gpio status command

Signed-off-by: Michal Simek michal.si...@xilinx.com
---
 arch/microblaze/include/asm/gpio.h |  50 +---
 .../xilinx/microblaze-generic/microblaze-generic.c |  17 +-
 drivers/gpio/Makefile  |   1 +
 drivers/gpio/xilinx_gpio.c | 323 +
 include/configs/microblaze-generic.h   |   3 +-
 5 files changed, 353 insertions(+), 41 deletions(-)
 create mode 100644 drivers/gpio/xilinx_gpio.c

diff --git a/arch/microblaze/include/asm/gpio.h 
b/arch/microblaze/include/asm/gpio.h
index 883f4d4..69df8c5 100644
--- a/arch/microblaze/include/asm/gpio.h
+++ b/arch/microblaze/include/asm/gpio.h
@@ -1,41 +1,21 @@
 #ifndef _ASM_MICROBLAZE_GPIO_H_
 #define _ASM_MICROBLAZE_GPIO_H_

-#include asm/io.h
+/* Allocation functions */
+extern int gpio_alloc_dual(u32 baseaddr, const char *name, u32 gpio_no0,
+  u32 gpio_no1);
+extern int gpio_alloc(u32 baseaddr, const char *name, u32 gpio_no);
+
+/* Standard functions */
+extern int gpio_request(unsigned gpio, const char *label);
+extern int gpio_free(unsigned gpio);
+extern int gpio_direction_input(unsigned gpio);
+extern int gpio_direction_output(unsigned gpio, int value);
+extern int gpio_get_value(unsigned gpio);
+extern int gpio_set_value(unsigned gpio, int value);
+extern int gpio_is_valid(int number);
+#define gpio_status()  gpio_info()
+extern void gpio_info(void);

-static inline int gpio_request(unsigned gpio, const char *label)
-{
-   return 0;
-}
-
-static inline int gpio_free(unsigned gpio)
-{
-   return 0;
-}
-
-static inline int gpio_direction_input(unsigned gpio)
-{
-   return 0;
-}
-
-static inline int gpio_direction_output(unsigned gpio, int value)
-{
-   return 0;
-}
-
-static inline int gpio_get_value(unsigned gpio)
-{
-   return 0;
-}
-
-static inline int gpio_set_value(unsigned gpio, int value)
-{
-   return 0;
-}
-
-static inline int gpio_is_valid(int number)
-{
-   return 0;
-}
 #endif

diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c 
b/board/xilinx/microblaze-generic/microblaze-generic.c
index befbb3a..2f5f20e 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -31,12 +31,17 @@
 #include asm/processor.h
 #include asm/microblaze_intc.h
 #include asm/asm.h
+#include asm/gpio.h
+
+#ifdef CONFIG_XILINX_GPIO
+static int reset_pin = -1;
+#endif

 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-#ifdef CONFIG_SYS_GPIO_0
-   *((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)) =
-   ++(*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)));
+#ifdef CONFIG_XILINX_GPIO
+   if (reset_pin != -1)
+   gpio_direction_output(reset_pin, 1);
 #endif

 #ifdef CONFIG_XILINX_TB_WATCHDOG
@@ -52,8 +57,10 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])

 int gpio_init (void)
 {
-#ifdef CONFIG_SYS_GPIO_0
-   *((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)) = 0x;
+#ifdef CONFIG_XILINX_GPIO
+   reset_pin = gpio_alloc(CONFIG_SYS_GPIO_0_ADDR, reset, 1);
+   if (reset_pin != -1)
+   gpio_request(reset_pin, reset_pin);
 #endif
return 0;
 }
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 9df1e26..830e8e6 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -47,6 +47,7 @@ COBJS-$(CONFIG_OMAP_GPIO) += omap_gpio.o
 COBJS-$(CONFIG_DB8500_GPIO)+= db8500_gpio.o
 COBJS-$(CONFIG_BCM2835_GPIO)   += bcm2835_gpio.o
 COBJS-$(CONFIG_S3C2440_GPIO)   += s3c2440_gpio.o
+COBJS-$(CONFIG_XILINX_GPIO)+= xilinx_gpio.o

 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
new file mode 100644
index 000..f2c289f
--- /dev/null
+++ b/drivers/gpio/xilinx_gpio.c
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2013 Xilinx, Michal Simek
+ *
+ * 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 

Re: [U-Boot] [RFC PATCH 0/1] GPIO support for Microblaze

2013-04-24 Thread Michal Simek
Hi Simon,

here is also one small problem if you want to use patman just for one patch
then cover letter contains 0/1 but patch itself doesn't contain 1/1.

I think will be good to just add 1/1 to patch too.

Generated by:
./tools/patman/patman -c 1

Thanks,
Michal


On 04/24/2013 10:27 AM, Michal Simek wrote:
 I want to also write gpio support for Zynq
 and this driver should be also used for arm zynq.
 
 Currently we have support just for only gpio controller
 but not for various of them.
 That's why I would like to get some input from you
 if possible to add dynamic gpio allocation which
 could be also helpful for OF support.
 
 Output from my gpio status on Microblaze is below.
 
 Thanks,
 Michal
 
 U-Boot gpio status
 
 gpio_info: reset/4000 (0-0)
 GPIO_0:   reset_pin is an INPUT value = 0
 
 gpio_info: led/4004 (1-5)
 GPIO_1:   UNKNOWN is an INPUT value = 0
 GPIO_2:   UNKNOWN is an OUTPUT value = 1
 GPIO_3:   UNKNOWN is an INPUT value = 0
 GPIO_4:   UNKNOWN is an INPUT value = 0
 GPIO_5:   UNKNOWN is an OUTPUT value = 0
 
 
 Michal Simek (1):
   gpio: Add support for microblaze xilinx GPIO
 
  arch/microblaze/include/asm/gpio.h |  50 +---
  .../xilinx/microblaze-generic/microblaze-generic.c |  17 +-
  drivers/gpio/Makefile  |   1 +
  drivers/gpio/xilinx_gpio.c | 323 
 +
  include/configs/microblaze-generic.h   |   3 +-
  5 files changed, 353 insertions(+), 41 deletions(-)
  create mode 100644 drivers/gpio/xilinx_gpio.c
 
 --
 1.8.2.1
 


-- 
Michal Simek, Ing. (M.Eng), OpenPGP - KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


[U-Boot] [PATCH 1/2] powerpc/85xx: Add C29x SoC support

2013-04-24 Thread Po Liu
From: Mingkai Hu mingkai...@freescale.com

The Freescale C29x family is a high performance crypto co-processor.
It combines a single e500v2 core with necessary SEC engine. There're
three SoC types(C291, C292, C293) with the following features:

 - 512K L2 Cache/SRAM and 512 KB platform SRAM
 - DDR3/DDR3L 32bit DDR controller
 - One PCI express (x1, x2, x4) Gen 2.0 Controller
 - Trust Architecture 2.0
 - SEC6.0 engine

Signed-off-by: Mingkai Hu mingkai...@freescale.com
Signed-off-by: Po Liu po@freescale.com
---
Base on the git://git.denx.de/u-boot.git
 arch/powerpc/cpu/mpc85xx/Makefile |  2 +
 arch/powerpc/cpu/mpc85xx/c29x_serdes.c| 65 +++
 arch/powerpc/cpu/mpc8xxx/cpu.c|  3 ++
 arch/powerpc/include/asm/config_mpc85xx.h | 20 ++
 arch/powerpc/include/asm/fsl_law.h|  1 +
 arch/powerpc/include/asm/immap_85xx.h | 23 +++
 arch/powerpc/include/asm/processor.h  |  3 ++
 7 files changed, 117 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc85xx/c29x_serdes.c

diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
b/arch/powerpc/cpu/mpc85xx/Makefile
index 6776c85..32eb761 100644
--- a/arch/powerpc/cpu/mpc85xx/Makefile
+++ b/arch/powerpc/cpu/mpc85xx/Makefile
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_MPC8568) += ddr-gen2.o
 COBJS-$(CONFIG_MPC8544) += ddr-gen2.o
 
 # supports ddr1/2/3
+COBJS-$(CONFIG_C29X)   += ddr-gen3.o
 COBJS-$(CONFIG_MPC8572) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8536) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8569)+= ddr-gen3.o
@@ -111,6 +112,7 @@ COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS1) += 
fsl_corenet_serdes.o
 COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS2) += fsl_corenet2_serdes.o
 
 # SoC specific SERDES support
+COBJS-$(CONFIG_C29X)   += c29x_serdes.o
 COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
 COBJS-$(CONFIG_MPC8544) += mpc8544_serdes.o
 COBJS-$(CONFIG_MPC8548) += mpc8548_serdes.o
diff --git a/arch/powerpc/cpu/mpc85xx/c29x_serdes.c 
b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
new file mode 100644
index 000..4b3214d
--- /dev/null
+++ b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ */
+
+#include config.h
+#include common.h
+#include asm/io.h
+#include asm/immap_85xx.h
+#include asm/fsl_serdes.h
+
+#define SRDS1_MAX_LANES4
+
+static u32 serdes1_prtcl_map;
+
+struct serdes_config {
+   u32 protocol;
+   u8 lanes[SRDS1_MAX_LANES];
+};
+
+static const struct serdes_config serdes1_cfg_tbl[] = {
+   /* SerDes 1 */
+   {1, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {2, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {3, {PCIE1, PCIE1, NONE, NONE} },
+   {4, {PCIE1, PCIE1, NONE, NONE} },
+   {5, {PCIE1, NONE, NONE, NONE} },
+   {6, {PCIE1, NONE, NONE, NONE} },
+   {}
+};
+
+int is_serdes_configured(enum srds_prtcl device)
+{
+   return (1  device)  serdes1_prtcl_map;
+}
+
+void fsl_serdes_init(void)
+{
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+   u32 pordevsr = in_be32(gur-pordevsr);
+   u32 srds_cfg = (pordevsr  MPC85xx_PORDEVSR_IO_SEL) 
+   MPC85xx_PORDEVSR_IO_SEL_SHIFT;
+   const struct serdes_config *ptr;
+   int lane;
+
+   debug(PORDEVSR[IO_SEL_SRDS] = %x\n, srds_cfg);
+
+   if (srds_cfg  ARRAY_SIZE(serdes1_cfg_tbl)) {
+   printf(Invalid PORDEVSR[IO_SEL_SRDS] = %d\n, srds_cfg);
+   return;
+   }
+
+   ptr = serdes1_cfg_tbl[srds_cfg];
+   if (!ptr-protocol)
+   return;
+
+   for (lane = 0; lane  SRDS1_MAX_LANES; lane++) {
+   enum srds_prtcl lane_prtcl = ptr-lanes[lane];
+   serdes1_prtcl_map |= (1  lane_prtcl);
+   }
+}
diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c
index 39525fb..478a852 100644
--- a/arch/powerpc/cpu/mpc8xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xxx/cpu.c
@@ -88,6 +88,9 @@ static struct cpu_type cpu_type_list[] = {
CPU_TYPE_ENTRY(BSC9131, 9131, 1),
CPU_TYPE_ENTRY(BSC9132, 9132, 2),
CPU_TYPE_ENTRY(BSC9232, 9232, 2),
+   CPU_TYPE_ENTRY(C291, C291, 1),
+   CPU_TYPE_ENTRY(C292, C292, 1),
+   CPU_TYPE_ENTRY(C293, C293, 1),
 #elif defined(CONFIG_MPC86xx)
CPU_TYPE_ENTRY(8610, 8610, 1),
CPU_TYPE_ENTRY(8641, 8641, 2),
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index d57c178..0ec0940 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -587,6 +587,26 @@
 #define CONFIG_SYS_FSL_ERRATUM_A_004934
 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe00
 
+#elif defined(CONFIG_C29X)
+#define CONFIG_MAX_CPUS1

[U-Boot] [PATCH 2/2] powerpc/c29xpcie: add support for C29XPCIE board

2013-04-24 Thread Po Liu
From: Mingkai Hu mingkai...@freescale.com

C29XPCIE board is a series of Freescale PCIe add-in cards to perform
as public key crypto accelerator or secure key management module. It
includes C293PCIE board, C293PCIE board and C291PCIE board.

 - 512KB platform SRAM in addition to 512K L2 Cache/SRAM
 - 512MB soldered DDR3 32bit memory
 - CPLD System Logic
 - 64MB x16 NOR flash and 4GB x8 NAND flash
 - 16MB SPI flash

Signed-off-by: Mingkai Hu mingkai...@freescale.com
Singed-off-by: Po Liu po@freescale.com
---
Base on the git://git.denx.de/u-boot.git
 board/freescale/c29xpcie/Makefile   |  34 +++
 board/freescale/c29xpcie/c29xpcie.c | 131 +
 board/freescale/c29xpcie/cpld.c | 155 ++
 board/freescale/c29xpcie/cpld.h |  53 
 board/freescale/c29xpcie/ddr.c  |  89 ++
 board/freescale/c29xpcie/law.c  |  22 ++
 board/freescale/c29xpcie/tlb.c  |  89 ++
 boards.cfg  |   6 +
 include/configs/C29XPCIE.h  | 562 
 9 files changed, 1141 insertions(+)
 create mode 100644 board/freescale/c29xpcie/Makefile
 create mode 100644 board/freescale/c29xpcie/c29xpcie.c
 create mode 100644 board/freescale/c29xpcie/cpld.c
 create mode 100644 board/freescale/c29xpcie/cpld.h
 create mode 100644 board/freescale/c29xpcie/ddr.c
 create mode 100644 board/freescale/c29xpcie/law.c
 create mode 100644 board/freescale/c29xpcie/tlb.c
 create mode 100644 include/configs/C29XPCIE.h

diff --git a/board/freescale/c29xpcie/Makefile 
b/board/freescale/c29xpcie/Makefile
new file mode 100644
index 000..15bef9a
--- /dev/null
+++ b/board/freescale/c29xpcie/Makefile
@@ -0,0 +1,34 @@
+#
+# Copyright 2013 Freescale Semiconductor, Inc.
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= cpld.o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/c29xpcie/c29xpcie.c 
b/board/freescale/c29xpcie/c29xpcie.c
new file mode 100644
index 000..07bdfef
--- /dev/null
+++ b/board/freescale/c29xpcie/c29xpcie.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * 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.
+ */
+
+#include common.h
+#include asm/processor.h
+#include asm/mmu.h
+#include asm/cache.h
+#include asm/immap_85xx.h
+#include asm/io.h
+#include miiphy.h
+#include libfdt.h
+#include fdt_support.h
+#include fsl_mdio.h
+#include tsec.h
+#include mmc.h
+#include netdev.h
+#include pci.h
+#include asm/fsl_ifc.h
+#include asm/fsl_pci.h
+
+#include cpld.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int checkboard(void)
+{
+   struct cpu_type *cpu = gd-arch.cpu;
+
+   printf(Board: %sPCIe, , cpu-name);
+   printf(CPLD Ver: 0x%02x\n, CPLD_READ(cpldver));
+
+   return 0;
+}
+
+int board_early_init_f(void)
+{
+   struct fsl_ifc *ifc = (void *)CONFIG_SYS_IFC_ADDR;
+
+   /* Clock configuration to access CPLD using IFC(GPCM) */
+   setbits_be32(ifc-ifc_gcr, 1  IFC_GCR_TBCTL_TRN_TIME_SHIFT);
+
+   return 0;
+}
+
+int board_early_init_r(void)
+{
+   const unsigned long flashbase = CONFIG_SYS_FLASH_BASE;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
+
+   /*
+* Remap Boot flash region to caching-inhibited
+* so that flash can be erased properly.
+*/
+
+   /* Flush d-cache and invalidate i-cache of any FLASH data */
+   flush_dcache();
+   invalidate_icache();
+
+   /* invalidate existing TLB entry for flash */
+   disable_tlb(flash_esel);
+
+   set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, flash_esel, BOOKE_PAGESZ_64M, 1);
+
+   return 0;
+}
+
+#ifdef CONFIG_PCI
+void pci_init_board(void)
+{
+   fsl_pcie_init_board(0);
+}
+#endif /* ifdef CONFIG_PCI */
+
+#ifdef CONFIG_TSEC_ENET
+int board_eth_init(bd_t *bis)
+{
+   struct fsl_pq_mdio_info mdio_info;
+   struct tsec_info_struct tsec_info[2];
+   int num 

[U-Boot] ECCN code for uboot

2013-04-24 Thread takeshi . harada . hq

Hi

I would like to know the ECCN code (Export control Classification code)
for uboot 1.1.5.

Thank you for your prompt attension.
Harry
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 0/5] ARM: OMAP: Cleanup save_boot_params function

2013-04-24 Thread Sricharan R
The save_boot_params function does not store the data in a
always writable area. So the code is broken for a 'XIP' boot.
This series corrects this by storing it in 'gd' and also
adds a 'C' equivalent function for the same. The essential cleanups
for the same are added in this.

Tested this on omap5 uevm board with SD/EMMC boot.
omap4/5 boards does not have a XIP flash.
So yet to test XIP with this series.

Also verfied a MAKEALL for armv7.

Sricharan R (5):
  ARM: OMAP: Make omap_boot_parameters common across socs
  ARM: OMAP4/5: Make OMAPx_SRAM_SCRATCH_ defines common
  ARM: OMAP: Correct save_boot_params and replace with 'C' function
  ARM: OMAP: Cleanup boot parameters usage
  ARM: OMAP: Add arch_cpu_init function

 arch/arm/cpu/armv7/lowlevel_init.S |8 +++-
 arch/arm/cpu/armv7/omap-common/boot-common.c   |   20 ++--
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |   61 +---
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |   50 +--
 arch/arm/cpu/armv7/omap4/emif.c|4 +-
 arch/arm/cpu/armv7/omap4/hw_data.c |2 +-
 arch/arm/cpu/armv7/omap4/hwinit.c  |3 +-
 arch/arm/cpu/armv7/omap5/emif.c|4 +-
 arch/arm/cpu/armv7/omap5/hw_data.c |2 +-
 arch/arm/cpu/armv7/omap5/hwinit.c  |3 +-
 arch/arm/include/asm/arch-am33xx/omap.h|   25 --
 arch/arm/include/asm/arch-omap4/omap.h |   36 --
 arch/arm/include/asm/arch-omap4/sys_proto.h|   11 ++---
 arch/arm/include/asm/arch-omap5/omap.h |   36 --
 arch/arm/include/asm/arch-omap5/sys_proto.h|   12 ++---
 arch/arm/include/asm/global_data.h |8 
 arch/arm/include/asm/omap_boot.h   |   50 +++
 arch/arm/include/asm/omap_common.h |   19 
 common/spl/spl.c   |   12 +++--
 include/configs/am335x_evm.h   |4 ++
 include/configs/omap4_common.h |4 ++
 include/configs/omap5_common.h |3 ++
 include/configs/pcm051.h   |4 ++
 include/configs/ti814x_evm.h   |4 ++
 include/spl.h  |1 -
 25 files changed, 187 insertions(+), 199 deletions(-)
 create mode 100644 arch/arm/include/asm/omap_boot.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 2/5] ARM: OMAP4/5: Make OMAPx_SRAM_SCRATCH_ defines common

2013-04-24 Thread Sricharan R
These defines are same across OMAP4/5. So move them to
omap_common.h. This is required for the patches that
follow.

Signed-off-by: Sricharan R r.sricha...@ti.com
---
[V2] Rebased on mainline.

 arch/arm/cpu/armv7/omap4/emif.c|4 ++--
 arch/arm/cpu/armv7/omap4/hw_data.c |2 +-
 arch/arm/cpu/armv7/omap4/hwinit.c  |3 ++-
 arch/arm/cpu/armv7/omap5/emif.c|4 ++--
 arch/arm/cpu/armv7/omap5/hw_data.c |2 +-
 arch/arm/cpu/armv7/omap5/hwinit.c  |3 ++-
 arch/arm/include/asm/arch-omap4/omap.h |   12 
 arch/arm/include/asm/arch-omap5/omap.h |   13 -
 arch/arm/include/asm/omap_common.h |   14 ++
 9 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/emif.c b/arch/arm/cpu/armv7/omap4/emif.c
index 53f6063..0ddf35f 100644
--- a/arch/arm/cpu/armv7/omap4/emif.c
+++ b/arch/arm/cpu/armv7/omap4/emif.c
@@ -31,8 +31,8 @@
 #include asm/utils.h
 
 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
-u32 *const T_num = (u32 *)OMAP4_SRAM_SCRATCH_EMIF_T_NUM;
-u32 *const T_den = (u32 *)OMAP4_SRAM_SCRATCH_EMIF_T_DEN;
+u32 *const T_num = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_NUM;
+u32 *const T_den = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_DEN;
 #endif
 
 #ifdef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
diff --git a/arch/arm/cpu/armv7/omap4/hw_data.c 
b/arch/arm/cpu/armv7/omap4/hw_data.c
index 04977b4..06a2fc8 100644
--- a/arch/arm/cpu/armv7/omap4/hw_data.c
+++ b/arch/arm/cpu/armv7/omap4/hw_data.c
@@ -40,7 +40,7 @@ struct dplls const **dplls_data =
 struct vcores_data const **omap_vcores =
(struct vcores_data const **) OMAP_SRAM_SCRATCH_VCORES_PTR;
 struct omap_sys_ctrl_regs const **ctrl =
-   (struct omap_sys_ctrl_regs const **)OMAP4_SRAM_SCRATCH_SYS_CTRL;
+   (struct omap_sys_ctrl_regs const **)OMAP_SRAM_SCRATCH_SYS_CTRL;
 
 /*
  * The M  N values in the following tables are created using the
diff --git a/arch/arm/cpu/armv7/omap4/hwinit.c 
b/arch/arm/cpu/armv7/omap4/hwinit.c
index 2db517b..81f5a48 100644
--- a/arch/arm/cpu/armv7/omap4/hwinit.c
+++ b/arch/arm/cpu/armv7/omap4/hwinit.c
@@ -34,10 +34,11 @@
 #include asm/sizes.h
 #include asm/emif.h
 #include asm/arch/gpio.h
+#include asm/omap_common.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 *const omap_si_rev = (u32 *)OMAP4_SRAM_SCRATCH_OMAP4_REV;
+u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
 
 static const struct gpio_bank gpio_bank_44xx[6] = {
{ (void *)OMAP44XX_GPIO1_BASE, METHOD_GPIO_24XX },
diff --git a/arch/arm/cpu/armv7/omap5/emif.c b/arch/arm/cpu/armv7/omap5/emif.c
index 3f37abd..b4c1319 100644
--- a/arch/arm/cpu/armv7/omap5/emif.c
+++ b/arch/arm/cpu/armv7/omap5/emif.c
@@ -32,8 +32,8 @@
 
 #ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
 #define print_timing_reg(reg) debug(#reg - 0x%08x\n, (reg))
-static u32 *const T_num = (u32 *)OMAP5_SRAM_SCRATCH_EMIF_T_NUM;
-static u32 *const T_den = (u32 *)OMAP5_SRAM_SCRATCH_EMIF_T_DEN;
+static u32 *const T_num = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_NUM;
+static u32 *const T_den = (u32 *)OMAP_SRAM_SCRATCH_EMIF_T_DEN;
 #endif
 
 #ifdef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
b/arch/arm/cpu/armv7/omap5/hw_data.c
index ced274e..e29803d 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -41,7 +41,7 @@ struct dplls const **dplls_data =
 struct vcores_data const **omap_vcores =
(struct vcores_data const **) OMAP_SRAM_SCRATCH_VCORES_PTR;
 struct omap_sys_ctrl_regs const **ctrl =
-   (struct omap_sys_ctrl_regs const **)OMAP5_SRAM_SCRATCH_SYS_CTRL;
+   (struct omap_sys_ctrl_regs const **)OMAP_SRAM_SCRATCH_SYS_CTRL;
 
 /* OPP HIGH FREQUENCY for ES2.0 */
 static const struct dpll_params mpu_dpll_params_1_5ghz[NUM_SYS_CLKS] = {
diff --git a/arch/arm/cpu/armv7/omap5/hwinit.c 
b/arch/arm/cpu/armv7/omap5/hwinit.c
index 2f4b247..e93f403 100644
--- a/arch/arm/cpu/armv7/omap5/hwinit.c
+++ b/arch/arm/cpu/armv7/omap5/hwinit.c
@@ -37,10 +37,11 @@
 #include asm/utils.h
 #include asm/arch/gpio.h
 #include asm/emif.h
+#include asm/omap_common.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
-u32 *const omap_si_rev = (u32 *)OMAP5_SRAM_SCRATCH_OMAP5_REV;
+u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
 
 static struct gpio_bank gpio_bank_54xx[6] = {
{ (void *)OMAP54XX_GPIO1_BASE, METHOD_GPIO_24XX },
diff --git a/arch/arm/include/asm/arch-omap4/omap.h 
b/arch/arm/include/asm/arch-omap4/omap.h
index 9ad1e82..e9a6ffe 100644
--- a/arch/arm/include/asm/arch-omap4/omap.h
+++ b/arch/arm/include/asm/arch-omap4/omap.h
@@ -143,16 +143,4 @@ struct s32ktimer {
 #define NON_SECURE_SRAM_END0x4030E000  /* Not inclusive */
 /* base address for indirect vectors (internal boot mode) */
 #define SRAM_ROM_VECT_BASE 0x4030D000
-/* Temporary SRAM stack used while low level init is done */
-#define SRAM_SCRATCH_SPACE_ADDRNON_SECURE_SRAM_START
-/* SRAM scratch space entries */
-#define 

[U-Boot] [PATCH V2 1/5] ARM: OMAP: Make omap_boot_parameters common across socs

2013-04-24 Thread Sricharan R
omap_boot_parameters is same and defined for each
soc. So move this to a common place to reuse it
across socs.

Signed-off-by: Sricharan R r.sricha...@ti.com
---
  [V2] Rebased on mainline.
 
 arch/arm/include/asm/arch-am33xx/omap.h |   25 
 arch/arm/include/asm/arch-omap4/omap.h  |   24 ---
 arch/arm/include/asm/arch-omap5/omap.h  |   23 ---
 arch/arm/include/asm/omap_boot.h|   49 +++
 4 files changed, 49 insertions(+), 72 deletions(-)
 create mode 100644 arch/arm/include/asm/omap_boot.h

diff --git a/arch/arm/include/asm/arch-am33xx/omap.h 
b/arch/arm/include/asm/arch-am33xx/omap.h
index d28f9a8..7e3bb9c 100644
--- a/arch/arm/include/asm/arch-am33xx/omap.h
+++ b/arch/arm/include/asm/arch-am33xx/omap.h
@@ -35,29 +35,4 @@
 #define NON_SECURE_SRAM_START  0x4030
 #define NON_SECURE_SRAM_END0x4032
 #endif
-
-/* ROM code defines */
-/* Boot device */
-#define BOOT_DEVICE_MASK   0xFF
-#define BOOT_DEVICE_OFFSET 0x8
-#define DEV_DESC_PTR_OFFSET0x4
-#define DEV_DATA_PTR_OFFSET0x18
-#define BOOT_MODE_OFFSET   0x8
-#define RESET_REASON_OFFSET0x9
-#define CH_FLAGS_OFFSET0xA
-
-#define CH_FLAGS_CHSETTINGS(0x1  0)
-#define CH_FLAGS_CHRAM (0x1  1)
-#define CH_FLAGS_CHFLASH   (0x1  2)
-#define CH_FLAGS_CHMMCSD   (0x1  3)
-
-#ifndef __ASSEMBLY__
-struct omap_boot_parameters {
-   char *boot_message;
-   unsigned int mem_boot_descriptor;
-   unsigned char omap_bootdevice;
-   unsigned char reset_reason;
-   unsigned char ch_flags;
-};
-#endif
 #endif
diff --git a/arch/arm/include/asm/arch-omap4/omap.h 
b/arch/arm/include/asm/arch-omap4/omap.h
index ad984da..9ad1e82 100644
--- a/arch/arm/include/asm/arch-omap4/omap.h
+++ b/arch/arm/include/asm/arch-omap4/omap.h
@@ -155,28 +155,4 @@ struct s32ktimer {
 #define OMAP4_SRAM_SCRATCH_SYS_CTRL(SRAM_SCRATCH_SPACE_ADDR + 0x20)
 #define OMAP4_SRAM_SCRATCH_SPACE_END   (SRAM_SCRATCH_SPACE_ADDR + 0x24)
 
-/* ROM code defines */
-/* Boot device */
-#define BOOT_DEVICE_MASK   0xFF
-#define BOOT_DEVICE_OFFSET 0x8
-#define DEV_DESC_PTR_OFFSET0x4
-#define DEV_DATA_PTR_OFFSET0x18
-#define BOOT_MODE_OFFSET   0x8
-#define RESET_REASON_OFFSET0x9
-#define CH_FLAGS_OFFSET0xA
-
-#define CH_FLAGS_CHSETTINGS(0x1  0)
-#define CH_FLAGS_CHRAM (0x1  1)
-#define CH_FLAGS_CHFLASH   (0x1  2)
-#define CH_FLAGS_CHMMCSD   (0x1  3)
-
-#ifndef __ASSEMBLY__
-struct omap_boot_parameters {
-   char *boot_message;
-   unsigned int mem_boot_descriptor;
-   unsigned char omap_bootdevice;
-   unsigned char reset_reason;
-   unsigned char ch_flags;
-};
-#endif
 #endif
diff --git a/arch/arm/include/asm/arch-omap5/omap.h 
b/arch/arm/include/asm/arch-omap5/omap.h
index 887fcaa..3bf5afa 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -214,21 +214,6 @@ struct s32ktimer {
 #define OMAP4460_ES1_0 0x44600100
 #define OMAP4460_ES1_1 0x44600110
 
-/* ROM code defines */
-/* Boot device */
-#define BOOT_DEVICE_MASK   0xFF
-#define BOOT_DEVICE_OFFSET 0x8
-#define DEV_DESC_PTR_OFFSET0x4
-#define DEV_DATA_PTR_OFFSET0x18
-#define BOOT_MODE_OFFSET   0x8
-#define RESET_REASON_OFFSET 0x9
-#define CH_FLAGS_OFFSET 0xA
-
-#define CH_FLAGS_CHSETTINGS(0x1  0)
-#defineCH_FLAGS_CHRAM  (0x1  1)
-#define CH_FLAGS_CHFLASH   (0x1  2)
-#define CH_FLAGS_CHMMCSD   (0x1  3)
-
 /* CONTROL_SRCOMP_XXX_SIDE */
 #define OVERRIDE_XS_SHIFT  30
 #define OVERRIDE_XS_MASK   (1  30)
@@ -249,14 +234,6 @@ struct srcomp_params {
s8 multiply_factor;
 };
 
-struct omap_boot_parameters {
-   char *boot_message;
-   unsigned int mem_boot_descriptor;
-   unsigned char omap_bootdevice;
-   unsigned char reset_reason;
-   unsigned char ch_flags;
-};
-
 struct ctrl_ioregs {
u32 ctrl_ddrch;
u32 ctrl_lpddr2ch;
diff --git a/arch/arm/include/asm/omap_boot.h b/arch/arm/include/asm/omap_boot.h
new file mode 100644
index 000..87a9530
--- /dev/null
+++ b/arch/arm/include/asm/omap_boot.h
@@ -0,0 +1,49 @@
+/*
+ * (C) Copyright 2013
+ * Texas Instruments, www.ti.com
+ *
+ * Sricharan R r.sricha...@ti.com
+ *
+ * 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 

[U-Boot] [PATCH V2 5/5] ARM: OMAP: Add arch_cpu_init function

2013-04-24 Thread Sricharan R
The boot parameters passed from SPL to UBOOT
must be saved as a part of uboot's gd data
as early as possible, before we will inadvertently
overwrite it. So adding a arch_cpu_init for the required
Socs to save it.

Signed-off-by: Sricharan R r.sricha...@ti.com
---
  [V2] Rebased on mainline.

 arch/arm/cpu/armv7/omap-common/hwinit-common.c |   11 +++
 include/configs/am335x_evm.h   |3 +++
 include/configs/omap4_common.h |4 
 include/configs/omap5_common.h |3 +++
 include/configs/pcm051.h   |3 +++
 include/configs/ti814x_evm.h   |3 +++
 6 files changed, 27 insertions(+)

diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c 
b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
index c710784..1645120 100644
--- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -147,6 +147,17 @@ static void save_omap_boot_params(void)
}
 }
 
+#ifdef CONFIG_ARCH_CPU_INIT
+/*
+ * SOC specific cpu init
+ */
+int arch_cpu_init(void)
+{
+   save_omap_boot_params();
+   return 0;
+}
+#endif /* CONFIG_ARCH_CPU_INIT */
+
 /*
  * Routine: s_init
  * Description: Does early system init of watchdog, muxing,  andclocks
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index ddfd52e..e5da51c 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -296,6 +296,9 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  { 110, 300, 600, 1200, 2400, \
 4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 }
 
+/* CPU */
+#define CONFIG_ARCH_CPU_INIT
+
 #define CONFIG_ENV_OVERWRITE   1
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index 1fd3097..2871d87 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -87,6 +87,10 @@
 #define CONFIG_BAUDRATE115200
 #define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
115200}
+
+/* CPU */
+#define CONFIG_ARCH_CPU_INIT
+
 /* I2C  */
 #define CONFIG_HARD_I2C1
 #define CONFIG_SYS_I2C_SPEED   10
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index c21c387..32c113e 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -86,6 +86,9 @@
 
 #define CONFIG_BAUDRATE115200
 
+/* CPU */
+#define CONFIG_ARCH_CPU_INIT
+
 /* I2C  */
 #define CONFIG_HARD_I2C
 #define CONFIG_SYS_I2C_SPEED   10
diff --git a/include/configs/pcm051.h b/include/configs/pcm051.h
index 5e5fab1..9614f70 100644
--- a/include/configs/pcm051.h
+++ b/include/configs/pcm051.h
@@ -195,6 +195,9 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  { 110, 300, 600, 1200, 2400, \
 4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 }
 
+/* CPU */
+#define CONFIG_ARCH_CPU_INIT
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 
diff --git a/include/configs/ti814x_evm.h b/include/configs/ti814x_evm.h
index 68a7307..8ba1e1b 100644
--- a/include/configs/ti814x_evm.h
+++ b/include/configs/ti814x_evm.h
@@ -163,6 +163,9 @@
 
 #define CONFIG_BAUDRATE115200
 
+/* CPU */
+#define CONFIG_ARCH_CPU_INIT
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_CONS_INDEX  1
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
-- 
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 3/5] ARM: OMAP: Correct save_boot_params and replace with 'C' function

2013-04-24 Thread Sricharan R
Currently save_boot_params saves the boot parameters passed
from romcode. But this is not stored in a writable location
consistently. So the current code would not work for a
'XIP' boot. Change this by saving the boot parameters in
'gd' which is always writable. Also add a 'C' function
instead of an assembly code that is more readable.

Signed-off-by: Sricharan R r.sricha...@ti.com
---
[V2] Fixed comments and rebased on mainline
 There is a checkpatch warning because of multiple
 assignments in the below mainline.
 gd-arch.omap_boot_params.omap_bootdevice = boot_device =
 . But the code is better readable this way

 arch/arm/cpu/armv7/omap-common/hwinit-common.c |   50 +---
 arch/arm/include/asm/global_data.h |8 
 arch/arm/include/asm/omap_boot.h   |1 +
 arch/arm/include/asm/omap_common.h |4 +-
 4 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c 
b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
index 70d16a8..c710784 100644
--- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -101,11 +101,6 @@ void omap_rev_string(void)
 }
 
 #ifdef CONFIG_SPL_BUILD
-static void init_boot_params(void)
-{
-   boot_params_ptr = (u32 *) boot_params;
-}
-
 void spl_display_print(void)
 {
omap_rev_string();
@@ -116,6 +111,42 @@ void __weak srcomp_enable(void)
 {
 }
 
+static void save_omap_boot_params(void)
+{
+   u32 rom_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS);
+   u8 boot_device;
+   u32 dev_desc, dev_data;
+
+   if ((rom_params   NON_SECURE_SRAM_START) ||
+   (rom_params  NON_SECURE_SRAM_END))
+   return;
+
+   /*
+* rom_params can be type casted to omap_boot_parameters and
+* used. But it not correct to assume that romcode structure
+* encoding would be same as u-boot. So use the defined offsets.
+*/
+   gd-arch.omap_boot_params.omap_bootdevice = boot_device =
+  *((u8 *)(rom_params + BOOT_DEVICE_OFFSET));
+
+   gd-arch.omap_boot_params.ch_flags =
+   *((u8 *)(rom_params + CH_FLAGS_OFFSET));
+
+   if ((boot_device = MMC_BOOT_DEVICES_START) 
+   (boot_device = MMC_BOOT_DEVICES_END)) {
+   if ((omap_hw_init_context() ==
+ OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)) {
+   gd-arch.omap_boot_params.omap_bootmode =
+   *((u8 *)(rom_params + BOOT_MODE_OFFSET));
+   } else {
+   dev_desc = *((u32 *)(rom_params + DEV_DESC_PTR_OFFSET));
+   dev_data = *((u32 *)(dev_desc + DEV_DATA_PTR_OFFSET));
+   gd-arch.omap_boot_params.omap_bootmode =
+   *((u32 *)(dev_data + BOOT_MODE_OFFSET));
+   }
+   }
+}
+
 /*
  * Routine: s_init
  * Description: Does early system init of watchdog, muxing,  andclocks
@@ -132,6 +163,14 @@ void __weak srcomp_enable(void)
  */
 void s_init(void)
 {
+   /*
+* Save the boot parameters passed from romcode.
+* We cannot delay the saving further than this,
+* to prevent overwrites.
+*/
+#ifdef CONFIG_SPL_BUILD
+   save_omap_boot_params();
+#endif
init_omap_revision();
hw_data_init();
 
@@ -156,7 +195,6 @@ void s_init(void)
 
/* For regular u-boot sdram_init() is called from dram_init() */
sdram_init();
-   init_boot_params();
 #endif
 }
 
diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index 37ac0da..7611d0a 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -24,6 +24,10 @@
 #ifndef__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#ifdef CONFIG_OMAP
+#include asm/omap_boot.h
+#endif
+
 /* Architecture-specific global data */
 struct arch_global_data {
 #if defined(CONFIG_FSL_ESDHC)
@@ -51,6 +55,10 @@ struct arch_global_data {
unsigned long tlb_addr;
unsigned long tlb_size;
 #endif
+
+#ifdef CONFIG_OMAP
+   struct omap_boot_parameters omap_boot_params;
+#endif
 };
 
 #include asm-generic/global_data.h
diff --git a/arch/arm/include/asm/omap_boot.h b/arch/arm/include/asm/omap_boot.h
index 87a9530..a803965 100644
--- a/arch/arm/include/asm/omap_boot.h
+++ b/arch/arm/include/asm/omap_boot.h
@@ -45,5 +45,6 @@ struct omap_boot_parameters {
unsigned char omap_bootdevice;
unsigned char reset_reason;
unsigned char ch_flags;
+   unsigned long omap_bootmode;
 };
 #endif
diff --git a/arch/arm/include/asm/omap_common.h 
b/arch/arm/include/asm/omap_common.h
index 6b70dbb..6b73d86 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -596,5 +596,7 @@ static inline u32 omap_revision(void)
 #define 

[U-Boot] [PATCH V2 4/5] ARM: OMAP: Cleanup boot parameters usage

2013-04-24 Thread Sricharan R
The boot parameters are read from individual variables
assigned for each of them. This been corrected and now
they are stored as a part of the global data 'gd'
structure. So read them from 'gd' instead.

Signed-off-by: Sricharan R r.sricha...@ti.com
---
  [V2] Addressed comments and rebased on mainline.

 arch/arm/cpu/armv7/lowlevel_init.S |8 +++-
 arch/arm/cpu/armv7/omap-common/boot-common.c   |   31 +++
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |   50 +---
 arch/arm/include/asm/arch-omap4/sys_proto.h|   11 ++
 arch/arm/include/asm/arch-omap5/sys_proto.h|   12 ++
 arch/arm/include/asm/omap_common.h |3 ++
 common/spl/spl.c   |   10 ++---
 include/configs/am335x_evm.h   |1 +
 include/configs/pcm051.h   |1 +
 include/configs/ti814x_evm.h   |1 +
 include/spl.h  |1 -
 11 files changed, 38 insertions(+), 91 deletions(-)

diff --git a/arch/arm/cpu/armv7/lowlevel_init.S 
b/arch/arm/cpu/armv7/lowlevel_init.S
index 0d45528..0a15aa4 100644
--- a/arch/arm/cpu/armv7/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/lowlevel_init.S
@@ -37,7 +37,13 @@ ENTRY(lowlevel_init)
 */
ldr sp, =CONFIG_SYS_INIT_SP_ADDR
bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
-
+#ifdef CONFIG_SPL_BUILD
+   ldr r8, =gdata
+#else
+   sub sp, #GD_SIZE
+   bic sp, sp, #7
+   mov r8, sp
+#endif
/*
 * Save the old lr(passed in ip) and the current lr to stack
 */
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 24cbe2d..bff7e9c 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -23,31 +23,17 @@
 #include asm/arch/mmc_host_def.h
 #include asm/arch/sys_proto.h
 
-/*
- * This is used to verify if the configuration header
- * was executed by rom code prior to control of transfer
- * to the bootloader. SPL is responsible for saving and
- * passing the boot_params pointer to the u-boot.
- */
-struct omap_boot_parameters boot_params __attribute__ ((section(.data)));
+DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SPL_BUILD
-/*
- * We use static variables because global data is not ready yet.
- * Initialized data is available in SPL right from the beginning.
- * We would not typically need to save these parameters in regular
- * U-Boot. This is needed only in SPL at the moment.
- */
-u32 omap_bootmode = MMCSD_MODE_FAT;
-
 u32 spl_boot_device(void)
 {
-   return (u32) (boot_params.omap_bootdevice);
+   return (u32) (gd-arch.omap_boot_params.omap_bootdevice);
 }
 
 u32 spl_boot_mode(void)
 {
-   return omap_bootmode;
+   return gd-arch.omap_boot_params.omap_bootmode;
 }
 
 void spl_board_init(void)
@@ -73,4 +59,15 @@ int board_mmc_init(bd_t *bis)
}
return 0;
 }
+
+void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
+{
+   typedef void __noreturn (*image_entry_noargs_t)(u32 *);
+   image_entry_noargs_t image_entry =
+   (image_entry_noargs_t) spl_image-entry_point;
+
+   debug(image entry point: 0x%X\n, spl_image-entry_point);
+   /* Pass the saved boot_params from rom code */
+   image_entry((u32 *)gd-arch.omap_boot_params);
+}
 #endif
diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S 
b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
index 90b3c8a..c489536 100644
--- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
@@ -28,59 +28,13 @@
 
 #include config.h
 #include asm/arch/omap.h
+#include asm/omap_common.h
 #include asm/arch/spl.h
 #include linux/linkage.h
 
 ENTRY(save_boot_params)
-   /*
-* See if the rom code passed pointer is valid:
-* It is not valid if it is not in non-secure SRAM
-* This may happen if you are booting with the help of
-* debugger
-*/
-   ldr r2, =NON_SECURE_SRAM_START
-   cmp r2, r0
-   bgt 1f
-   ldr r2, =NON_SECURE_SRAM_END
-   cmp r2, r0
-   blt 1f
-
-   /*
-* store the boot params passed from rom code or saved
-* and passed by SPL
-*/
-   cmp r0, #0
-   beq 1f
-   ldr r1, =boot_params
+   ldr r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
str r0, [r1]
-#ifdef CONFIG_SPL_BUILD
-   /* Store the boot device in spl_boot_device */
-   ldrbr2, [r0, #BOOT_DEVICE_OFFSET]   @ r1 - value of boot device
-   and r2, #BOOT_DEVICE_MASK
-   ldr r3, =boot_params
-   strbr2, [r3, #BOOT_DEVICE_OFFSET]   @ spl_boot_device - r1
-
-   /*
-* boot mode is only valid for device that can be raw or FAT booted.
-* in other cases it may be fatal to look.  While platforms differ
-

Re: [U-Boot] [PATCH V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Benoît Thébaudeau
Hi Stefano,

On Wednesday, April 24, 2013 9:39:17 AM, Stefano Babic wrote:
 On 21/04/2013 22:29, Marek Vasut wrote:
  Dear Benoît Thébaudeau,
  
  Dear Marek Vasut,
 
 
 Hi Marek,
 
  On Sunday, April 21, 2013 9:12:31 PM, Marek Vasut wrote:
  Dear Benoît Thébaudeau,
 
  Dear Marek Vasut,
 
  On Sunday, April 21, 2013 5:52:27 PM, Marek Vasut wrote:
  Add basic support for the DENX M53EVK board. Currently supported is:
  MMC (incl. booting)
 
   ^
 
  Can you clarify this, please?
 
  Use u-boot.imx for SD booting as usual.
 
  spl_boot_device() points only to NAND, so
  you're clearly talking about hardware MMC boot, and not about hardware
  NAND boot followed by SPL payload fetched from MMC. But MMC boot does
  not need SPL here, in which case you will have to generate a simple
  u-boot.imx, or you will rather want to use u-boot-with-spl.imx for SD
  (NAND header dropped to leave room for MBR). And in the latter case,
  why have spl_boot_device() point to NAND for MMC boot?
 
  No, regular u-boot.imx will be used for SD boot.
 
  OK. So this will require to call make with u-boot.imx as the explicit
  target. Should this be documented somewhere, perhaps in a README file for
  this board?
 
  Another solution would be, like for woodburn, to have an sd-specific
  config: - m53evk_nand_config would define CONFIG_SPL from boards.cfg, so
 u-boot-with-nand-spl.imx would be generated.
   - mx53evk_sd_config would not define CONFIG_SPL from boards.cfg, so
  u-boot.imx would be generated.
  And CONFIG_SPL would be removed from m53evk.h.
 
  Or, change the various config.mk in order to build u-boot.imx even if
  CONFIG_SPL is defined, which would be useless for some boards, but useful
  here in order to avoid having 2 configs for almost the same build, while
  still not having to explicitly give a make target.
  
  I'd love to see generic u-boot.nand , u-boot.sd etc. targets instead of
  these
  CPU specific stuffs.
  
 
 But you forget that a single image can be saved on multiple storage:
 u-boot.imx can be stored on SD or NOR or SPI-NOR, and that is the reason
 for having SOC-specific extension.
 
 I agree with Benoit: at the moment, only people working with i.MX know
 that u-boot.im runs on SD. The third solution proposed by Benoit has the
 drawback that probably not all boards need u-boot.imx (a board without
 SD for example). At least we need an update of the README, but I think
 it is not bad to have a new entry in boards.cfg.
 
 Apart of that and not related to this patch, if we in future use SPL
 also for booting from SD, we can get a single way to boot from different
 storage. TI based SOCs already do this: same SPL, it checks from SD and
 NAND.

With this also comes the issue of BOOT_FROM in board/denx/m53evk/imximage.cfg.
Strictly speaking, in order to be correct, it should be #if-ed depending on some
config option: nand or sd.

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


Re: [U-Boot] ECCN code for uboot

2013-04-24 Thread Wolfgang Denk
Dear Harry,

In message XNM2$7$1$4$$7$7$5$A$1011953u51779...@hitachi.com you wrote:
 
 I would like to know the ECCN code (Export control Classification code)
 for uboot 1.1.5.

There has never been any formal ECCN assignment for U-Boot - at least
none that I know of.  On the other hand, it is a a free Software
project that shares some code, some community and a lot of the
development methods with the Linux kernel and some distributions that
include and use these.  So it is eventually a pretty safe guess to use
the same ECCN.

For example, the Fedora Export Control Product Matrix at [1] uses
5D002 for the Fedora Linux distribution. The same ECCN is also used
by the Linux Foundation's Yocto Project [2] which includes U-Boot for
a number of board configurations.

So my best bet is that  5D002  is also a suitable ECCN for U-Boot.

But then - IANAL ...

[1] http://fedoraproject.org/wiki/Legal/Export
[2] https://www.yoctoproject.org/tools-resources/export-compliance


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Question: How does one get fresh air into a Russian church?
Answer:   One clicks on an icon, and a window opens!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support

2013-04-24 Thread Dirk Eibach
Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
Cc: Heiko Schocher h...@denx.de
Cc: Stefan Roese s...@denx.de
---
 drivers/i2c/Makefile |2 +-
 drivers/i2c/ppc4xx_i2c.c |  193 +++---
 2 files changed, 97 insertions(+), 98 deletions(-)

diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
index 564d061..0298e3e 100644
--- a/drivers/i2c/Makefile
+++ b/drivers/i2c/Makefile
@@ -36,7 +36,6 @@ COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o
-COBJS-$(CONFIG_PPC4XX_I2C) += ppc4xx_i2c.o
 COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
@@ -45,6 +44,7 @@ COBJS-$(CONFIG_SH_I2C) += sh_i2c.o
 COBJS-$(CONFIG_SH_SH7734_I2C) += sh_sh7734_i2c.o
 COBJS-$(CONFIG_SYS_I2C) += i2c_core.o
 COBJS-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
+COBJS-$(CONFIG_SYS_I2C_PPC4XX) += ppc4xx_i2c.o
 COBJS-$(CONFIG_SYS_I2C_SOFT) += soft_i2c.o
 COBJS-$(CONFIG_SYS_I2C_TEGRA) += tegra_i2c.o
 
diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
index 53fedd5..c924874 100644
--- a/drivers/i2c/ppc4xx_i2c.c
+++ b/drivers/i2c/ppc4xx_i2c.c
@@ -32,27 +32,29 @@
 #include i2c.h
 #include asm/io.h
 
-#ifdef CONFIG_HARD_I2C
-
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_I2C_MULTI_BUS)
-/*
- * Initialize the bus pointer to whatever one the SPD EEPROM is on.
- * Default is bus 0.  This is necessary because the DDR initialization
- * runs from ROM, and we can't switch buses because we can't modify
- * the global variables.
- */
-#ifndef CONFIG_SYS_SPD_BUS_NUM
-#define CONFIG_SYS_SPD_BUS_NUM 0
+static inline struct ppc4xx_i2c *ppc4xx_get_i2c(int hwadapnr)
+{
+   unsigned long base;
+
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+   defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+   defined(CONFIG_460EX) || defined(CONFIG_460GT)
+   base = CONFIG_SYS_PERIPHERAL_BASE + 0x0700 + (hwadapnr * 0x100);
+#elif defined(CONFIG_440) || defined(CONFIG_405EX)
+/* all remaining 440 variants */
+   base = CONFIG_SYS_PERIPHERAL_BASE + 0x0400 + (hwadapnr * 0x100);
+#else
+/* all 405 variants */
+   base = 0xEF600500 + (hwadapnr * 0x100);
 #endif
-static unsigned int i2c_bus_num __attribute__ ((section (.data))) =
-   CONFIG_SYS_SPD_BUS_NUM;
-#endif /* CONFIG_I2C_MULTI_BUS */
+   return (struct ppc4xx_i2c *)base;
+}
 
-static void _i2c_bus_reset(void)
+static void _i2c_bus_reset(struct i2c_adapter *adap)
 {
-   struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
+   struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap-hwadapnr);
int i;
u8 dc;
 
@@ -91,11 +93,10 @@ static void _i2c_bus_reset(void)
out_8(i2c-xtcntlss, 0);
 }
 
-void i2c_init(int speed, int slaveaddr)
+static void ppc4xx_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr)
 {
-   struct ppc4xx_i2c *i2c;
+   struct ppc4xx_i2c *i2c = ppc4xx_get_i2c(adap-hwadapnr);
int val, divisor;
-   int bus;
 
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
/*
@@ -106,67 +107,57 @@ void i2c_init(int speed, int slaveaddr)
i2c_init_board();
 #endif
 
-   for (bus = 0; bus  CONFIG_SYS_MAX_I2C_BUS; bus++) {
-   I2C_SET_BUS(bus);
-
-   /* Set i2c pointer after calling I2C_SET_BUS() */
-   i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR;
-
-   /* Handle possible failed I2C state */
-   /* FIXME: put this into i2c_init_board()? */
-   _i2c_bus_reset();
+   /* Handle possible failed I2C state */
+   /* FIXME: put this into i2c_init_board()? */
+   _i2c_bus_reset(adap);
 
-   /* clear lo master address */
-   out_8(i2c-lmadr, 0);
+   /* clear lo master address */
+   out_8(i2c-lmadr, 0);
 
-   /* clear hi master address */
-   out_8(i2c-hmadr, 0);
-
-   /* clear lo slave address */
-   out_8(i2c-lsadr, 0);
+   /* clear hi master address */
+   out_8(i2c-hmadr, 0);
 
-   /* clear hi slave address */
-   out_8(i2c-hsadr, 0);
+   /* clear lo slave address */
+   out_8(i2c-lsadr, 0);
 
-   /* Clock divide Register */
-   /* set divisor according to freq_opb */
-   divisor = (get_OPB_freq() - 1) / 1000;
-   if (divisor == 0)
-   divisor = 1;
-   out_8(i2c-clkdiv, divisor);
+   /* clear hi slave address */
+   out_8(i2c-hsadr, 0);
 
-   /* no interrupts */
-   out_8(i2c-intrmsk, 0);
+   /* Clock divide Register */
+   /* set divisor according to freq_opb */
+   divisor = (get_OPB_freq() - 1) / 1000;
+   if (divisor == 0)
+   divisor = 1;
+   out_8(i2c-clkdiv, divisor);
 

Re: [U-Boot] [PATCH] usb: common: Use a global definition for 'min3'

2013-04-24 Thread Marek Vasut
Dear Vivek Gautam,

 Hi Marek,
 
 
 On Wed, Apr 24, 2013 at 11:49 AM, Vivek Gautam
 
 gautamvivek1...@gmail.com wrote:
  On Mon, Apr 22, 2013 at 7:15 PM, Tom Rini tr...@ti.com wrote:
  On Fri, Apr 19, 2013 at 01:29:12PM +0200, Marek Vasut wrote:
  Dear Vivek Gautam,
  
   We can use a common global method for calculating minimum of
   3 numbers. Put the same in 'common header' and let 'ehci'
   use it.
   
   Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
  
  Applied, thanks
  
  NAK, sorry.  Lets re-sync with the kernel's min/max/min3/max3 defines
  here instead.
  
  Alright, i shall sync the definitions with Linux kernel and send the
  patch for same.
 
 Will you be dropping this patch from u-boot-usb/next or shall i send a
 subsequent patch on
 top of this ?

Dropped and pushed

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


[U-Boot] [PATCH 1/2] mpc5200: a3m071/a4m2k: Fix problem with increased global_data struct

2013-04-24 Thread Stefan Roese
The v2013.04 release has this patch set included:

5cb48582 Add architecture-specific global data

With this, the global_data struct is now common and new variables
have been added. Resulting in a bigger struct. Unfortunately the
currently allocated 128 bytes are just a bit too small for this
new struct. So lets increase the reserved space to solve this
issue.

Please note that this problem might hit some other platforms which
currently reserve a tight space of 128 bytes for the global_data
struct!

Signed-off-by: Stefan Roese s...@denx.de
---
 include/configs/a3m071.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/configs/a3m071.h b/include/configs/a3m071.h
index 13f3226..b0264c2 100644
--- a/include/configs/a3m071.h
+++ b/include/configs/a3m071.h
@@ -121,8 +121,7 @@
 #define CONFIG_SYS_INIT_RAM_ADDR   MPC5XXX_SRAM
 #define CONFIG_SYS_INIT_RAM_ENDMPC5XXX_SRAM_SIZE
 
-
-#define CONFIG_SYS_GBL_DATA_SIZE   128
+#define CONFIG_SYS_GBL_DATA_SIZE   256
 #define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \
 CONFIG_SYS_GBL_DATA_SIZE)
 #define CONFIG_SYS_INIT_SP_OFFSET  CONFIG_SYS_GBL_DATA_OFFSET
-- 
1.8.2.1

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


[U-Boot] [PATCH 2/2] mpc5200: a3m071/a4m2k: Add redundant environment support

2013-04-24 Thread Stefan Roese
Also move the environment offset a bit to allow bigger u-boot
images.

Signed-off-by: Stefan Roese s...@denx.de
---
 include/configs/a3m071.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/configs/a3m071.h b/include/configs/a3m071.h
index b0264c2..b2d3642 100644
--- a/include/configs/a3m071.h
+++ b/include/configs/a3m071.h
@@ -88,7 +88,10 @@
  */
 #define CONFIG_SYS_FLASH_BASE  0xfc00
 #define CONFIG_SYS_FLASH_SIZE  0x0200
-#define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 
0x4)
+#define CONFIG_ENV_ADDR(CONFIG_SYS_FLASH_BASE + 
0x8)
+/* Address and size of Redundant Environment Sector*/
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
 #define CONFIG_SYS_MAX_FLASH_SECT  256
-- 
1.8.2.1

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


Re: [U-Boot] Add filesystem support

2013-04-24 Thread Pietro Paolini

On Apr 23, 2013, at 5:54 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Pietro Paolini,
 
 In message 51c80aa5-303e-4737-864c-6d05577d1...@aol.com you wrote:
 
 I am working on an embedded system which we would like upgrade using a new 
 filesystem YAFFS2 instead of the old JFFS2, we actually mount the JFFS2
 partition from U-Boot and then we start  the kernel. I looked in the boot 
 source tree we actually use and I did not find YAFFS2 (or UBIFS ..) 
 
 Hm... I recommend to look at the mailine U-Boot tree instead:
 
   - ls fs
   Makefile  cbfs  cramfs  ext4  fat  fdos  fs.c  jffs2  reiserfs
   sandbox  ubifs  yaffs2  zfs
 
 under the fs/ folder, then I assume I don't have it. I'd like add that 
 support without update the whole uboot source tree, is it possible or is too 
 much complicated ? 
 
 This depends a lot on which exact version of U-Boot you are running
 now, but given the fact that you see neither yaffs2 nor ubifs it
 appears to be _very_ old, so you're probably out of luck.
 
 On the other hand - switching to mainline code is usually a very good
 idea anyway, so go for that.
 
 Best regards,
 
 Wolfgang Denk
 
 -- 
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 You'll pay to know what you really think.- J.R. Bob Dobbs


Hello Wolfgang,
thank you so much.
I have got another question :-) 

If I see under the fs/ the yaffs2/ and the ubifs/ folders I can assume that I 
can read and write them
from uboot or there are some limitations like I can read but I can't write ? In 
the U-Boot website I was not able to
find a list of filesystem supported, my fault I guess.

Best Regards,
Pietro.




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


Re: [U-Boot] [RFC] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support

2013-04-24 Thread Heiko Schocher
Hello Dirk,

On 24.04.2013 13:43, Dirk Eibach wrote:
 Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
 Cc: Heiko Schocher h...@denx.de
 Cc: Stefan Roese s...@denx.de
 ---
  drivers/i2c/Makefile |2 +-
  drivers/i2c/ppc4xx_i2c.c |  193 
 +++---
  2 files changed, 97 insertions(+), 98 deletions(-)

Did you tried this patch with the mutlibus/multiadapter
framework?

When switching one i2c driver to this new Framework, you
must adapt all config files, which use this driver ...
Sorry, some stupid work, but it must be done, without
this I will bet, MAKEALL fails ...

[...]
 diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
 index 53fedd5..c924874 100644
 --- a/drivers/i2c/ppc4xx_i2c.c
 +++ b/drivers/i2c/ppc4xx_i2c.c
[...]
 +#ifdef CONFIG_SYS_I2C_PPC4XX_CH0

You introduce here new defines, please document them in
the README, thanks!

 +U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_0, ppc4xx_i2c_init, ppc4xx_i2c_probe,
 +  ppc4xx_i2c_read, ppc4xx_i2c_write,
 +  ppc4xx_i2c_set_bus_speed,
 +  CONFIG_SYS_I2C_PPC4XX_SPEED_0,
 +  CONFIG_SYS_I2C_PPC4XX_SLAVE_0, 0)
 +#endif
 +#ifdef CONFIG_SYS_I2C_PPC4XX_CH1
 +U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_1, ppc4xx_i2c_init, ppc4xx_i2c_probe,
 +  ppc4xx_i2c_read, ppc4xx_i2c_write,
 +  ppc4xx_i2c_set_bus_speed,
 +  CONFIG_SYS_I2C_PPC4XX_SPEED_1,
 +  CONFIG_SYS_I2C_PPC4XX_SLAVE_1, 1)
 +#endif

beside of this, your patch looks good ...

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] usb: ss: Fixes for super speed framework

2013-04-24 Thread Vivek Gautam
This patch series fixes changes for Super speed framework
which got pulled-in 'u-boot-usb/next'.
First patch fixes Port Status and Port feature macro constants,
then next patch parallelizes power-cycling of power on root-hub
ports.
3rd patch in this series also sync the min3/max3 definitions
with Linux kernel.

Based on u-boot-usb/next branch with following patch reverted:
usb: hub: Reset only usb 2.0 ports

Vivek Gautam (3):
  usb: hub: Parallelize power-cycling of root-hub ports
  usb: fix: Fixing Port status and feature number constants
  usb: common: Use a global definition for 'min3'

 common/usb_hub.c|   63 --
 drivers/usb/host/ehci-hcd.c |   10 ---
 include/common.h|   25 ++---
 include/usb_defs.h  |   39 +++---
 4 files changed, 86 insertions(+), 51 deletions(-)

-- 
1.7.6.5

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


[U-Boot] [PATCH 1/3] usb: hub: Parallelize power-cycling of root-hub ports

2013-04-24 Thread Vivek Gautam
Untill now we power-cycle (aka: disable power on a port
and re-enabling again) one port at a time.
Delay of 20ms for Port-power to change multiplies with
number of ports in this case.
So better we parallelize this process:
disable power on all ports, wait for port-power to stabilize
and then re-enable the power subsequently.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 common/usb_hub.c |   23 ++-
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index 1e225e6..dad0409 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -105,22 +105,25 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
int ret;
 
dev = hub-pusb_dev;
-   /* Enable power to the ports */
+
+   /*
+* Enable power to the ports:
+* Here we Power-cycle the ports: aka,
+* turning them off and turning on again.
+*/
debug(enabling power on all ports\n);
for (i = 0; i  dev-maxchild; i++) {
-   /*
-* Power-cycle the ports here: aka,
-* turning them off and turning on again.
-*/
usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
debug(port %d returns %lX\n, i + 1, dev-status);
+   }
 
-   /* Wait at least 2*bPwrOn2PwrGood for PP to change */
-   mdelay(pgood_delay);
+   /* Wait at least 2*bPwrOn2PwrGood for PP to change */
+   mdelay(pgood_delay);
 
+   for (i = 0; i  dev-maxchild; i++) {
ret = usb_get_port_status(dev, i + 1, portsts);
if (ret  0) {
-   debug(port %d: get_port_status failed\n, i + 1);
+   printf(port %d: get_port_status failed\n, i + 1);
return;
}
 
@@ -135,10 +138,12 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 */
portstatus = le16_to_cpu(portsts-wPortStatus);
if (portstatus  (USB_PORT_STAT_POWER  1)) {
-   debug(port %d: Port power change failed\n, i + 1);
+   printf(port %d: Port power change failed\n, i + 1);
return;
}
+   }
 
+   for (i = 0; i  dev-maxchild; i++) {
usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
debug(port %d returns %lX\n, i + 1, dev-status);
}
-- 
1.7.6.5

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


[U-Boot] [PATCH 2/3] usb: fix: Fixing Port status and feature number constants

2013-04-24 Thread Vivek Gautam
Fix the Port status bit constants and Port feature number
constants as a part of USB 2.0 and USB 3.0 Hub class.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 common/usb_hub.c   |   40 
 include/usb_defs.h |   39 +++
 2 files changed, 51 insertions(+), 28 deletions(-)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index dad0409..d9816e4 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -170,14 +170,24 @@ static struct usb_hub_device *usb_hub_allocate(void)
 
 static inline char *portspeed(int portstatus)
 {
-   if (portstatus  (1  USB_PORT_FEAT_SUPERSPEED))
-   return 5 Gb/s;
-   else if (portstatus  (1  USB_PORT_FEAT_HIGHSPEED))
-   return 480 Mb/s;
-   else if (portstatus  (1  USB_PORT_FEAT_LOWSPEED))
-   return 1.5 Mb/s;
-   else
-   return 12 Mb/s;
+   char *speed_str;
+
+   switch (portstatus  USB_PORT_STAT_SPEED_MASK) {
+   case USB_PORT_STAT_SUPER_SPEED:
+   speed_str = 5 Gb/s;
+   break;
+   case USB_PORT_STAT_HIGH_SPEED:
+   speed_str = 480 Mb/s;
+   break;
+   case USB_PORT_STAT_LOW_SPEED:
+   speed_str = 1.5 Mb/s;
+   break;
+   default:
+   speed_str = 12 Mb/s;
+   break;
+   }
+
+   return speed_str;
 }
 
 int hub_port_reset(struct usb_device *dev, int port,
@@ -275,14 +285,20 @@ void usb_hub_port_connect_change(struct usb_device *dev, 
int port)
/* Allocate a new device struct for it */
usb = usb_alloc_new_device(dev-controller);
 
-   if (portstatus  USB_PORT_STAT_SUPER_SPEED)
+   switch (portstatus  USB_PORT_STAT_SPEED_MASK) {
+   case USB_PORT_STAT_SUPER_SPEED:
usb-speed = USB_SPEED_SUPER;
-   else if (portstatus  USB_PORT_STAT_HIGH_SPEED)
+   break;
+   case USB_PORT_STAT_HIGH_SPEED:
usb-speed = USB_SPEED_HIGH;
-   else if (portstatus  USB_PORT_STAT_LOW_SPEED)
+   break;
+   case USB_PORT_STAT_LOW_SPEED:
usb-speed = USB_SPEED_LOW;
-   else
+   break;
+   default:
usb-speed = USB_SPEED_FULL;
+   break;
+   }
 
dev-children[port] = usb;
usb-parent = dev;
diff --git a/include/usb_defs.h b/include/usb_defs.h
index 6ce6791..4f3601a 100644
--- a/include/usb_defs.h
+++ b/include/usb_defs.h
@@ -215,8 +215,6 @@
 #define USB_PORT_FEAT_POWER  8
 #define USB_PORT_FEAT_LOWSPEED   9
 #define USB_PORT_FEAT_HIGHSPEED  10
-#define USB_PORT_FEAT_FULLSPEED  11
-#define USB_PORT_FEAT_SUPERSPEED 12
 #define USB_PORT_FEAT_C_CONNECTION   16
 #define USB_PORT_FEAT_C_ENABLE   17
 #define USB_PORT_FEAT_C_SUSPEND  18
@@ -224,6 +222,17 @@
 #define USB_PORT_FEAT_C_RESET20
 #define USB_PORT_FEAT_TEST   21
 
+/*
+ * Changes to Port feature numbers for Super speed,
+ * from USB 3.0 spec Table 10-8
+ */
+#define USB_SS_PORT_FEAT_U1_TIMEOUT23
+#define USB_SS_PORT_FEAT_U2_TIMEOUT24
+#define USB_SS_PORT_FEAT_C_LINK_STATE  25
+#define USB_SS_PORT_FEAT_C_CONFIG_ERROR26
+#define USB_SS_PORT_FEAT_BH_RESET  28
+#define USB_SS_PORT_FEAT_C_BH_RESET29
+
 /* wPortStatus bits */
 #define USB_PORT_STAT_CONNECTION0x0001
 #define USB_PORT_STAT_ENABLE0x0002
@@ -233,20 +242,18 @@
 #define USB_PORT_STAT_POWER 0x0100
 #define USB_PORT_STAT_LOW_SPEED 0x0200
 #define USB_PORT_STAT_HIGH_SPEED0x0400 /* support for EHCI */
-#define USB_PORT_STAT_FULL_SPEED0x0800
-#define USB_PORT_STAT_SUPER_SPEED   0x1000 /* support for XHCI */
-#define USB_PORT_STAT_SPEED\
-   (USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED | \
-   USB_PORT_STAT_FULL_SPEED | USB_PORT_STAT_SUPER_SPEED)
+#define USB_PORT_STAT_SUPER_SPEED   0x0600 /* faking support to XHCI */
+#define USB_PORT_STAT_SPEED_MASK   \
+   (USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)
 
 /*
- * Additions to wPortStatus bit field from USB 3.0
- * See USB 3.0 spec Table 10-10
+ * Changes to wPortStatus bit field in USB 3.0
+ * See USB 3.0 spec Table 10-11
  */
-#define USB_PORT_STAT_LINK_STATE   0x01e0
+#define USB_SS_PORT_STAT_LINK_STATE0x01e0
 #define USB_SS_PORT_STAT_POWER 0x0200
 #define USB_SS_PORT_STAT_SPEED 0x1c00
-#define USB_PORT_STAT_SPEED_5GBPS  0x
+#define USB_SS_PORT_STAT_SPEED_5GBPS   0x
 
 /* wPortChange bits */
 #define USB_PORT_STAT_C_CONNECTION  0x0001
@@ -256,12 +263,12 @@
 #define USB_PORT_STAT_C_RESET   0x0010
 
 /*
- * Addition to wPortChange bit fields form USB 3.0
- * See USB 3.0 spec Table 10-11
+ * Changes to wPortChange bit fields in USB 3.0
+ * See USB 3.0 spec Table 10-12
  */
-#define USB_PORT_STAT_C_BH_RESET   0x0020
-#define USB_PORT_STAT_C_LINK_STATE 0x0040
-#define USB_PORT_STAT_C_CONFIG_ERROR   0x0080
+#define 

[U-Boot] [PATCH 3/3] usb: common: Use a global definition for 'min3'

2013-04-24 Thread Vivek Gautam
We can use a common global method for calculating minimum of
3 numbers. Put the same in 'common header' and let 'ehci'
use it.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 drivers/usb/host/ehci-hcd.c |   10 --
 include/common.h|   25 +
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 19d4352..e0f3e4b 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -603,16 +603,6 @@ fail:
return -1;
 }
 
-static inline int min3(int a, int b, int c)
-{
-
-   if (b  a)
-   a = b;
-   if (c  a)
-   a = c;
-   return a;
-}
-
 int
 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 int length, struct devrequest *req)
diff --git a/include/common.h b/include/common.h
index 0cfa6a8..b0258a0 100644
--- a/include/common.h
+++ b/include/common.h
@@ -199,18 +199,35 @@ typedef void (interrupt_handler_t)(void *);
  * General Purpose Utilities
  */
 #define min(X, Y)  \
-   ({ typeof (X) __x = (X);\
-   typeof (Y) __y = (Y);   \
+   ({ typeof(X) __x = (X); \
+   typeof(Y) __y = (Y);\
(__x  __y) ? __x : __y; })
 
 #define max(X, Y)  \
-   ({ typeof (X) __x = (X);\
-   typeof (Y) __y = (Y);   \
+   ({ typeof(X) __x = (X); \
+   typeof(Y) __y = (Y);\
(__x  __y) ? __x : __y; })
 
 #define MIN(x, y)  min(x, y)
 #define MAX(x, y)  max(x, y)
 
+#define min3(X, Y, Z)  \
+   ({ typeof(X) __x = (X); \
+   typeof(Y) __y = (Y);\
+   typeof(Z) __z = (Z);\
+   __x  __y ? (__x  __z ? __x : __z) :   \
+   (__y  __z ? __y : __z); })
+
+#define max3(X, Y, Z)  \
+   ({ typeof(X) __x = (X); \
+   typeof(Y) __y = (Y);\
+   typeof(Z) __z = (Z);\
+   __x  __y ? (__x  __z ? __x : __z) :   \
+   (__y  __z ? __y : __z); })
+
+#define MIN3(x, y, z)  min3(x, y, z)
+#define MAX3(x, y, z)  max3(x, y, z)
+
 /*
  * Return the absolute value of a number.
  *
-- 
1.7.6.5

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


Re: [U-Boot] [RFC] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support

2013-04-24 Thread Dirk Eibach

Hello Heiko,


On 24.04.2013 13:43, Dirk Eibach wrote:

Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
Cc: Heiko Schocher h...@denx.de
Cc: Stefan Roese s...@denx.de
---
 drivers/i2c/Makefile |2 +-
 drivers/i2c/ppc4xx_i2c.c |  193 
+++---

 2 files changed, 97 insertions(+), 98 deletions(-)


Did you tried this patch with the mutlibus/multiadapter
framework?


sure. This RFC is based on 20130416_multibus_v2.


When switching one i2c driver to this new Framework, you
must adapt all config files, which use this driver ...
Sorry, some stupid work, but it must be done, without
this I will bet, MAKEALL fails ...


Certainly. But before starting this, I wanted to make sure, that the 
basic implementation is allright.



[...]

diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
index 53fedd5..c924874 100644
--- a/drivers/i2c/ppc4xx_i2c.c
+++ b/drivers/i2c/ppc4xx_i2c.c

[...]

+#ifdef CONFIG_SYS_I2C_PPC4XX_CH0


You introduce here new defines, please document them in
the README, thanks!


OK.

+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_0, ppc4xx_i2c_init, 
ppc4xx_i2c_probe,

+ppc4xx_i2c_read, ppc4xx_i2c_write,
+ppc4xx_i2c_set_bus_speed,
+CONFIG_SYS_I2C_PPC4XX_SPEED_0,
+CONFIG_SYS_I2C_PPC4XX_SLAVE_0, 0)
+#endif
+#ifdef CONFIG_SYS_I2C_PPC4XX_CH1
+U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_1, ppc4xx_i2c_init, 
ppc4xx_i2c_probe,

+ppc4xx_i2c_read, ppc4xx_i2c_write,
+ppc4xx_i2c_set_bus_speed,
+CONFIG_SYS_I2C_PPC4XX_SPEED_1,
+CONFIG_SYS_I2C_PPC4XX_SLAVE_1, 1)
+#endif


beside of this, your patch looks good ...


Fine, so I will start adapting all dependent boards. Should the patch 
be based on 20130416_multibus_v2 or should I post a series based on 
v2013.04 that includes the 20130416_multibus_v2 changes?


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


Re: [U-Boot] [RFC] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support

2013-04-24 Thread Heiko Schocher
Hello Dirk,

On 24.04.2013 15:00, Dirk Eibach wrote:
 Hello Heiko,
 
 On 24.04.2013 13:43, Dirk Eibach wrote:
 Signed-off-by: Dirk Eibach dirk.eib...@gdsys.cc
 Cc: Heiko Schocher h...@denx.de
 Cc: Stefan Roese s...@denx.de
 ---
  drivers/i2c/Makefile |2 +-
  drivers/i2c/ppc4xx_i2c.c |  193 
 +++---
  2 files changed, 97 insertions(+), 98 deletions(-)

 Did you tried this patch with the mutlibus/multiadapter
 framework?
 
 sure. This RFC is based on 20130416_multibus_v2.

Great! :-)

Also with soft_i2c driver in use?

 When switching one i2c driver to this new Framework, you
 must adapt all config files, which use this driver ...
 Sorry, some stupid work, but it must be done, without
 this I will bet, MAKEALL fails ...
 
 Certainly. But before starting this, I wanted to make sure, that the 
 basic implementation is allright.

Yep, looks fine too me.

 [...]
 diff --git a/drivers/i2c/ppc4xx_i2c.c b/drivers/i2c/ppc4xx_i2c.c
 index 53fedd5..c924874 100644
 --- a/drivers/i2c/ppc4xx_i2c.c
 +++ b/drivers/i2c/ppc4xx_i2c.c
 [...]
 +#ifdef CONFIG_SYS_I2C_PPC4XX_CH0

 You introduce here new defines, please document them in
 the README, thanks!
 
 OK.

Thanks!

 +U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_0, ppc4xx_i2c_init, 
 ppc4xx_i2c_probe,
 +ppc4xx_i2c_read, ppc4xx_i2c_write,
 +ppc4xx_i2c_set_bus_speed,
 +CONFIG_SYS_I2C_PPC4XX_SPEED_0,
 +CONFIG_SYS_I2C_PPC4XX_SLAVE_0, 0)
 +#endif
 +#ifdef CONFIG_SYS_I2C_PPC4XX_CH1
 +U_BOOT_I2C_ADAP_COMPLETE(ppc4xx_1, ppc4xx_i2c_init, 
 ppc4xx_i2c_probe,
 +ppc4xx_i2c_read, ppc4xx_i2c_write,
 +ppc4xx_i2c_set_bus_speed,
 +CONFIG_SYS_I2C_PPC4XX_SPEED_1,
 +CONFIG_SYS_I2C_PPC4XX_SLAVE_1, 1)
 +#endif

 beside of this, your patch looks good ...
 
 Fine, so I will start adapting all dependent boards. Should the patch 
 be based on 20130416_multibus_v2 or should I post a series based on 
 v2013.04 that includes the 20130416_multibus_v2 changes?

Against 20130416_multibus_v2 and if the merge window opens
I post this patch with the other patches for this new
i2c framework on the ML.

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC] i2c, ppc4xx_i2c: switch to new multibus/multiadapter support

2013-04-24 Thread Stefan Roese
Hi Heiko,

On 24.04.2013 15:04, Heiko Schocher wrote:

 Fine, so I will start adapting all dependent boards. Should the patch 
 be based on 20130416_multibus_v2 or should I post a series based on 
 v2013.04 that includes the 20130416_multibus_v2 changes?
 
 Against 20130416_multibus_v2 and if the merge window opens
 I post this patch with the other patches for this new
 i2c framework on the ML.

The merge window is already open. :)

Thanks,
Stefan

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


Re: [U-Boot] [PATCH 3/3] usb: common: Use a global definition for 'min3'

2013-04-24 Thread Vivek Gautam
CC: Tom Rini


On Wed, Apr 24, 2013 at 6:20 PM, Vivek Gautam gautam.vi...@samsung.com wrote:
 We can use a common global method for calculating minimum of
 3 numbers. Put the same in 'common header' and let 'ehci'
 use it.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 ---
  drivers/usb/host/ehci-hcd.c |   10 --
  include/common.h|   25 +
  2 files changed, 21 insertions(+), 14 deletions(-)

 diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
 index 19d4352..e0f3e4b 100644
 --- a/drivers/usb/host/ehci-hcd.c
 +++ b/drivers/usb/host/ehci-hcd.c
 @@ -603,16 +603,6 @@ fail:
 return -1;
  }

 -static inline int min3(int a, int b, int c)
 -{
 -
 -   if (b  a)
 -   a = b;
 -   if (c  a)
 -   a = c;
 -   return a;
 -}
 -
  int
  ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
  int length, struct devrequest *req)
 diff --git a/include/common.h b/include/common.h
 index 0cfa6a8..b0258a0 100644
 --- a/include/common.h
 +++ b/include/common.h
 @@ -199,18 +199,35 @@ typedef void (interrupt_handler_t)(void *);
   * General Purpose Utilities
   */
  #define min(X, Y)  \
 -   ({ typeof (X) __x = (X);\
 -   typeof (Y) __y = (Y);   \
 +   ({ typeof(X) __x = (X); \
 +   typeof(Y) __y = (Y);\
 (__x  __y) ? __x : __y; })

  #define max(X, Y)  \
 -   ({ typeof (X) __x = (X);\
 -   typeof (Y) __y = (Y);   \
 +   ({ typeof(X) __x = (X); \
 +   typeof(Y) __y = (Y);\
 (__x  __y) ? __x : __y; })

  #define MIN(x, y)  min(x, y)
  #define MAX(x, y)  max(x, y)

 +#define min3(X, Y, Z)  \
 +   ({ typeof(X) __x = (X); \
 +   typeof(Y) __y = (Y);\
 +   typeof(Z) __z = (Z);\
 +   __x  __y ? (__x  __z ? __x : __z) :   \
 +   (__y  __z ? __y : __z); })
 +
 +#define max3(X, Y, Z)  \
 +   ({ typeof(X) __x = (X); \
 +   typeof(Y) __y = (Y);\
 +   typeof(Z) __z = (Z);\
 +   __x  __y ? (__x  __z ? __x : __z) :   \
 +   (__y  __z ? __y : __z); })
 +
 +#define MIN3(x, y, z)  min3(x, y, z)
 +#define MAX3(x, y, z)  max3(x, y, z)
 +
  /*
   * Return the absolute value of a number.
   *
 --
 1.7.6.5



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


Re: [U-Boot] Add filesystem support

2013-04-24 Thread Wolfgang Denk
Dear Pietro,

In message 31afec52-ad37-4385-b8a1-06f6c51c9...@aol.com you wrote:
 
 If I see under the fs/ the yaffs2/ and the ubifs/ folders I can assume
 that I can read and write them
 from uboot or there are some limitations like I can read but I can't
 write ? In the U-Boot website I was not able to
 find a list of filesystem supported, my fault I guess.

Most file systems are supported read-only in U-Boot.

Yaffs2 includes write support in U-Boot, ubifs does not.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
PROGRAM - n.  A magic spell cast over a computer  allowing it to turn
one's input into error messages.
v. tr. - To engage in a pastime similar to banging one's head against
a wall, but with fewer opportunities for reward.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 01/10] imx: Homogenize and fix fuse register definitions

2013-04-24 Thread Benoît Thébaudeau
On Tuesday, April 23, 2013 10:17:38 PM, Benoît Thébaudeau wrote:
 IIM:
  - Homogenize prg_p naming (the reference manuals are not always
  self-consistent
for that).
  - Add missing SCSx and bank registers.
  - Fix the number of banks on i.MX53.
 
 OCOTP:
  - Rename iim to ocotp in order to avoid confusion.
  - Rename fuse_data to read_fuse_data, and sticky to sw_sticky, according to
  the
reference manual.
  - Merge the existing spinoff gp1 fuse definition on i.MX6.
  - Fix the number of banks on i.MX6.
 
 Signed-off-by: Benoît Thébaudeau benoit.thebaud...@advansee.com

FYI, I have build- and runtime-tested this series on i.MX25/35/51/6, and
build-tested it on mpc512x.

Note that the original OCOTP driver from Freescale has several bugs in the
function setting the timing register:
 - It sets tRELAX to 15.2 ns although it should be  16.2 ns (for 66-MHz IPG
   clock).
 - It uses DEF_RELAX instead of relax to set strobe_prog/read, i.e. it mixes ns
   with IPG clock cycles. The result is tPGM = 10.6 µs instead of 10 µs (but
   9 µs  tPGM  11 µs is still satisfied), and tRD = 636 ns  36 ns. So just by
   chance, this does not break the hardware behavior.
 - It unexpectedly clears the WAIT bit-field, which has a non-zero reset value.

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 v2 2/3] net: ks8851_mll: add ethernet support

2013-04-24 Thread Raffaele Recalcati
Hi Bo,

On 10:46 Wed 24 Apr , Bo Shen wrote:
 From: Roberto Cerati roberto.cer...@bticino.it
 
 The device interface is 16 bits wide.
 All the available packets are read from the incoming fifo.
 
 Signed-off-by: Roberto Cerati roberto.cer...@bticino.it
 Signed-off-by: Raffaele Recalcati raffaele.recalc...@bticino.it
 [voice.s...@atmel.com: address comments from review results]
 [voice.s...@atmel.com: clean up for submit]
 Signed-off-by: Bo Shen voice.s...@atmel.com
 ---
 Change in v2
   - keep the comment style the same with other drivers
   - remove tab between #define and micro
 ---
  drivers/net/Makefile |1 +
  drivers/net/ks8851_mll.c |  645 
 ++
  drivers/net/ks8851_mll.h |  357 +
  include/netdev.h |1 +
  4 files changed, 1004 insertions(+)
  create mode 100644 drivers/net/ks8851_mll.c
  create mode 100644 drivers/net/ks8851_mll.h
 
 diff --git a/drivers/net/Makefile b/drivers/net/Makefile
 index 786a656..f4cc072 100644
 --- a/drivers/net/Makefile
 +++ b/drivers/net/Makefile
 @@ -50,6 +50,7 @@ COBJS-$(CONFIG_FTMAC100) += ftmac100.o
  COBJS-$(CONFIG_GRETH) += greth.o
  COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
  COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 +COBJS-$(CONFIG_KS8851_MLL) += ks8851_mll.o
  COBJS-$(CONFIG_LAN91C96) += lan91c96.o
  COBJS-$(CONFIG_MACB) += macb.o
  COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
 new file mode 100644
 index 000..b02d59a
 --- /dev/null
 +++ b/drivers/net/ks8851_mll.c
 @@ -0,0 +1,645 @@
 +/*
 + * Micrel KS8851_MLL 16bit Network driver
 + * Copyright (c) 2011 Roberto Cerati roberto.cer...@bticino.it
 + *
 + * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 + */
 +
 +#include asm/io.h
 +#include common.h
 +#include command.h
 +#include malloc.h
 +#include net.h
 +#include miiphy.h
 +
 +#include ks8851_mll.h
 +
 +#define DRIVERNAME   ks8851_mll
 +
 +#define MAX_RECV_FRAMES   32
 +#define MAX_BUF_SIZE   2048
 +#define TX_BUF_SIZE   2000
 +#define RX_BUF_SIZE   2000
 +
 +static const struct chip_id chip_ids[] =  {
 + {CIDER_ID, KSZ8851},
 + {0, NULL},
 +};
 +
 +/*
 + * union ks_tx_hdr - tx header data
 + * @txb: The header as bytes
 + * @txw: The header as 16bit, little-endian words
 + *
 + * A dual representation of the tx header data to allow
 + * access to individual bytes, and to allow 16bit accesses
 + * with 16bit alignment.
 + */
 +union ks_tx_hdr {
 + u8  txb[4];
 + __le16  txw[2];
 +};
 +
 +/*
 + * struct ks_net - KS8851 driver private data
 + * @net_device : The network device we're bound to
 + * @txh  : temporaly buffer to save status/length.
 + * @frame_head_info : frame header information for multi-pkt rx.
 + * @statelock : Lock on this structure for tx list.
 + * @msg_enable : The message flags controlling driver output (see ethtool).
 + * @frame_cnt : number of frames received.
 + * @bus_width : i/o bus width.
 + * @irq  : irq number assigned to this device.
 + * @rc_rxqcr : Cached copy of KS_RXQCR.
 + * @rc_txcr : Cached copy of KS_TXCR.
 + * @rc_ier : Cached copy of KS_IER.
 + * @sharedbus : Multipex(addr and data bus) mode indicator.
 + * @cmd_reg_cache : command register cached.
 + * @cmd_reg_cache_int : command register cached. Used in the irq handler.
 + * @promiscuous : promiscuous mode indicator.
 + * @all_mcast : mutlicast indicator.
 + * @mcast_lst_size : size of multicast list.
 + * @mcast_lst  : multicast list.
 + * @mcast_bits  : multicast enabed.
 + * @mac_addr  : MAC address assigned to this device.
 + * @fid   : frame id.
 + * @extra_byte  : number of extra byte prepended rx pkt.
 + * @enabled  : indicator this device works.
 + */
 +
 +/* Receive multiplex framer header info */
 +struct type_frame_head {
 + u16 sts; /* Frame status */
 + u16 len; /* Byte count */
 +} fr_h_i[MAX_RECV_FRAMES];
 +
 +struct ks_net {
 + struct net_device *netdev;
 + union ks_tx_hdr  txh;
 + struct type_frame_head *frame_head_info;
 + u32   msg_enable;
 + u32   frame_cnt;
 + int   bus_width;
 + int   irq;
 + u16   rc_rxqcr;
 + u16   rc_txcr;
 + u16   rc_ier;
 + u16   sharedbus;
 + u16   cmd_reg_cache;
 + u16   cmd_reg_cache_int;
 + u16   promiscuous;
 + u16   all_mcast;
 + u16   mcast_lst_size;
 + u8   

Re: [U-Boot] [RFC PATCH] WIP: Simplified device model implementation and demo

2013-04-24 Thread Pavel Herrmann
Hello

On Wednesday 24 of April 2013 08:53:09 Simon Glass wrote:
 From: Pavel Herrmann morpheus.i...@gmail.com
 
 ** Please note that this is very early code. I am sending out an RFC to
 get comments. This is not a commit message. This will only build on sandbox
 and all you can do it try the 'demo' command. I am most interested in
 comments about how to optimise the implementation to minimise impact on
 existing drivers, minimise code bloat and make use of existing knowledge
 users may have another other driver model implementations (e.g. Linux).
 
 This patch adds a very simple drive model implementation. It is taken from
 the driver model code developed by:
 
Marek Vasut ma...@denx.de
Pavel Herrmann morpheus.i...@gmail.com
Viktor Křivák viktor.kri...@gmail.com
Tomas Hlavacek tmshl...@gmail.com
 
 and possible others?
 
 Please see doc/driver-model/README.txt for details of how to run this and
 what to look for.
 
 You can find a test version of the code used here in branch dm2 at:
 
http://git.denx.de/u-boot-x86.git
 
 (Branch dm contains the original implementation)
 
 This patch requires sandbox generic board support and other enhancements.
 
 Signed-off-by: Simon Glass s...@chromium.org


Thanks for building on our design!

What actually happened (for those who were wondering) is that we sucesfully 
defended the university project part of this (which required us to have a 
working build, that did not necessarily adhere to what would be applicable to 
U-Boot upstream, so we dropped of the map for some time), and then went into 
rethink and upgrade mode of operations.

I can see that you have already implemented some ot he changes I had in mind 
(keeping size of private data as a part of the driver, so relocation can be 
done semi-automatically). I actually had a little more automation in mind 
(specifically the calls to core_replace, or uclass_replace in your naming 
scheme, and core_remove), which would mean that for a driver with a flat 
private data structure (which would be most of them), no relocation hook would 
be needed. Of course, we could arguably remove relocation as a whole, and use 
DM only after the relocation has taken place.

I agree with the naming change, we started wth the instances+cores, and then 
stuck with it (and added some more).

as for (some of) your changes, i would have a few comments:

the driver_instance wrapper around instance was created so that the driver 
itself doesn't have access to its status flags (currently only the activated 
flag) and siblings, as it should need them, and definitely should ever modify 
them. There was no other level of indirection, because the struct instance was 
embedded in struct driver_instance (eg. not a pointer).

I dont see where/if you actually do anything with the private_data_size (didnt 
read the whole yet), but i certianly didnt find it used for smarter relocations 
(see above).
There is one more problem with the DM structures management, which is not 
entirely obvious - there is currently no way to tell whether platform_data is 
in static memory or not (and therefore if it should be relocated/freed. this 
would of course require to remember the size somewhere). this will arise when 
you start handling dynamically generated devices (disks, USB)

As for removal of platform data, this is not possible. You can load them from 
FDT for static devices, but it will still be required in dynamic devices 
(again, port number for a disk, USB descriptor number for an USB device). Also 
relocation/deallocation of platform data is not currently handled in DM code, 
which causes a slight memory leak.

driver_activate() should not be called by the user (or bootup routine) at any 
point, instead it should be called by the classes when/before proxying the 
call to the driver specified implementation. We had it in our bootup code only 
to show that it is possible to do selectively.

having a list_head for uclass membership in the struct device is not really a 
good idea, for two reasons. the biggest one is that some of the classes will 
need to keep some information about the devices, that is not usable outside 
the class (id/name for a disk, mapping to global linear numbering for 
GPIO...). This kind of information is used in queries give me a device with 
specific properties, instead of the generic give me Nth device of this 
class, The other problem is that it disallows the device to support multiple 
classes (this could probably be worked around by having virtual child devices 
for this case) - an exapmle that would use this would be a RAM disk, which you 
would want to still behave as a normal disk, but be tracked by a separate 
class (so you can resize/delete/whatever it),

I like how you cache the driver structure for each device, instead of looking 
it up every time. I cannot recall why we didnt use this approach, but i would 
point out that the name is present/used so we can have runtime loadable 
drivers sometime in the 

Re: [U-Boot] [PATCH 2/3] usb: fix: Fixing Port status and feature number constants

2013-04-24 Thread Julius Werner
On Wed, Apr 24, 2013 at 5:50 AM, Vivek Gautam gautam.vi...@samsung.com wrote:
 Fix the Port status bit constants and Port feature number
 constants as a part of USB 2.0 and USB 3.0 Hub class.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 ---
  common/usb_hub.c   |   40 
  include/usb_defs.h |   39 +++
  2 files changed, 51 insertions(+), 28 deletions(-)

 diff --git a/common/usb_hub.c b/common/usb_hub.c
 index dad0409..d9816e4 100644
 --- a/common/usb_hub.c
 +++ b/common/usb_hub.c
 @@ -170,14 +170,24 @@ static struct usb_hub_device *usb_hub_allocate(void)

  static inline char *portspeed(int portstatus)
  {
 -   if (portstatus  (1  USB_PORT_FEAT_SUPERSPEED))
 -   return 5 Gb/s;
 -   else if (portstatus  (1  USB_PORT_FEAT_HIGHSPEED))
 -   return 480 Mb/s;
 -   else if (portstatus  (1  USB_PORT_FEAT_LOWSPEED))
 -   return 1.5 Mb/s;
 -   else
 -   return 12 Mb/s;
 +   char *speed_str;
 +
 +   switch (portstatus  USB_PORT_STAT_SPEED_MASK) {
 +   case USB_PORT_STAT_SUPER_SPEED:
 +   speed_str = 5 Gb/s;
 +   break;
 +   case USB_PORT_STAT_HIGH_SPEED:
 +   speed_str = 480 Mb/s;
 +   break;
 +   case USB_PORT_STAT_LOW_SPEED:
 +   speed_str = 1.5 Mb/s;
 +   break;
 +   default:
 +   speed_str = 12 Mb/s;
 +   break;
 +   }
 +
 +   return speed_str;
  }

Just a nitpick... you could save 8 lines here by moving the return
into the case blocks. Rest of the patch set LGTM.


  int hub_port_reset(struct usb_device *dev, int port,
 @@ -275,14 +285,20 @@ void usb_hub_port_connect_change(struct usb_device 
 *dev, int port)
 /* Allocate a new device struct for it */
 usb = usb_alloc_new_device(dev-controller);

 -   if (portstatus  USB_PORT_STAT_SUPER_SPEED)
 +   switch (portstatus  USB_PORT_STAT_SPEED_MASK) {
 +   case USB_PORT_STAT_SUPER_SPEED:
 usb-speed = USB_SPEED_SUPER;
 -   else if (portstatus  USB_PORT_STAT_HIGH_SPEED)
 +   break;
 +   case USB_PORT_STAT_HIGH_SPEED:
 usb-speed = USB_SPEED_HIGH;
 -   else if (portstatus  USB_PORT_STAT_LOW_SPEED)
 +   break;
 +   case USB_PORT_STAT_LOW_SPEED:
 usb-speed = USB_SPEED_LOW;
 -   else
 +   break;
 +   default:
 usb-speed = USB_SPEED_FULL;
 +   break;
 +   }

 dev-children[port] = usb;
 usb-parent = dev;
 diff --git a/include/usb_defs.h b/include/usb_defs.h
 index 6ce6791..4f3601a 100644
 --- a/include/usb_defs.h
 +++ b/include/usb_defs.h
 @@ -215,8 +215,6 @@
  #define USB_PORT_FEAT_POWER  8
  #define USB_PORT_FEAT_LOWSPEED   9
  #define USB_PORT_FEAT_HIGHSPEED  10
 -#define USB_PORT_FEAT_FULLSPEED  11
 -#define USB_PORT_FEAT_SUPERSPEED 12
  #define USB_PORT_FEAT_C_CONNECTION   16
  #define USB_PORT_FEAT_C_ENABLE   17
  #define USB_PORT_FEAT_C_SUSPEND  18
 @@ -224,6 +222,17 @@
  #define USB_PORT_FEAT_C_RESET20
  #define USB_PORT_FEAT_TEST   21

 +/*
 + * Changes to Port feature numbers for Super speed,
 + * from USB 3.0 spec Table 10-8
 + */
 +#define USB_SS_PORT_FEAT_U1_TIMEOUT23
 +#define USB_SS_PORT_FEAT_U2_TIMEOUT24
 +#define USB_SS_PORT_FEAT_C_LINK_STATE  25
 +#define USB_SS_PORT_FEAT_C_CONFIG_ERROR26
 +#define USB_SS_PORT_FEAT_BH_RESET  28
 +#define USB_SS_PORT_FEAT_C_BH_RESET29
 +
  /* wPortStatus bits */
  #define USB_PORT_STAT_CONNECTION0x0001
  #define USB_PORT_STAT_ENABLE0x0002
 @@ -233,20 +242,18 @@
  #define USB_PORT_STAT_POWER 0x0100
  #define USB_PORT_STAT_LOW_SPEED 0x0200
  #define USB_PORT_STAT_HIGH_SPEED0x0400 /* support for EHCI */
 -#define USB_PORT_STAT_FULL_SPEED0x0800
 -#define USB_PORT_STAT_SUPER_SPEED   0x1000 /* support for XHCI */
 -#define USB_PORT_STAT_SPEED\
 -   (USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED | \
 -   USB_PORT_STAT_FULL_SPEED | USB_PORT_STAT_SUPER_SPEED)
 +#define USB_PORT_STAT_SUPER_SPEED   0x0600 /* faking support to XHCI */
 +#define USB_PORT_STAT_SPEED_MASK   \
 +   (USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)

  /*
 - * Additions to wPortStatus bit field from USB 3.0
 - * See USB 3.0 spec Table 10-10
 + * Changes to wPortStatus bit field in USB 3.0
 + * See USB 3.0 spec Table 10-11
   */
 -#define USB_PORT_STAT_LINK_STATE   0x01e0
 +#define USB_SS_PORT_STAT_LINK_STATE0x01e0
  #define USB_SS_PORT_STAT_POWER 0x0200
  #define USB_SS_PORT_STAT_SPEED 0x1c00
 -#define USB_PORT_STAT_SPEED_5GBPS  0x
 +#define USB_SS_PORT_STAT_SPEED_5GBPS   0x

  /* wPortChange bits */
  #define USB_PORT_STAT_C_CONNECTION  0x0001
 @@ -256,12 +263,12 @@
  #define USB_PORT_STAT_C_RESET   0x0010

  /*
 - * 

Re: [U-Boot] [PATCH V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Marek Vasut
Dear Stefano Babic,

 On 21/04/2013 22:29, Marek Vasut wrote:
  Dear Benoît Thébaudeau,
  
  Dear Marek Vasut,
 
 Hi Marek,
 
  On Sunday, April 21, 2013 9:12:31 PM, Marek Vasut wrote:
  Dear Benoît Thébaudeau,
  
  Dear Marek Vasut,
  
  On Sunday, April 21, 2013 5:52:27 PM, Marek Vasut wrote:
  Add basic support for the DENX M53EVK board. Currently supported is:
  MMC (incl. booting)
  
   ^
  
  Can you clarify this, please?
  
  Use u-boot.imx for SD booting as usual.
  
  spl_boot_device() points only to NAND, so
  you're clearly talking about hardware MMC boot, and not about hardware
  NAND boot followed by SPL payload fetched from MMC. But MMC boot does
  not need SPL here, in which case you will have to generate a simple
  u-boot.imx, or you will rather want to use u-boot-with-spl.imx for SD
  (NAND header dropped to leave room for MBR). And in the latter case,
  why have spl_boot_device() point to NAND for MMC boot?
  
  No, regular u-boot.imx will be used for SD boot.
  
  OK. So this will require to call make with u-boot.imx as the explicit
  target. Should this be documented somewhere, perhaps in a README file
  for this board?
  
  Another solution would be, like for woodburn, to have an sd-specific
  config: - m53evk_nand_config would define CONFIG_SPL from boards.cfg, so
  
 u-boot-with-nand-spl.imx would be generated.
   
   - mx53evk_sd_config would not define CONFIG_SPL from boards.cfg, so
  
  u-boot.imx would be generated.
  And CONFIG_SPL would be removed from m53evk.h.
  
  Or, change the various config.mk in order to build u-boot.imx even if
  CONFIG_SPL is defined, which would be useless for some boards, but
  useful here in order to avoid having 2 configs for almost the same
  build, while still not having to explicitly give a make target.
  
  I'd love to see generic u-boot.nand , u-boot.sd etc. targets instead of
  these CPU specific stuffs.
 
 But you forget that a single image can be saved on multiple storage:
 u-boot.imx can be stored on SD or NOR or SPI-NOR, and that is the reason
 for having SOC-specific extension.
 
 I agree with Benoit: at the moment, only people working with i.MX know
 that u-boot.im runs on SD. The third solution proposed by Benoit has the
 drawback that probably not all boards need u-boot.imx (a board without
 SD for example). At least we need an update of the README, but I think
 it is not bad to have a new entry in boards.cfg.
 
 Apart of that and not related to this patch, if we in future use SPL
 also for booting from SD, we can get a single way to boot from different
 storage. TI based SOCs already do this: same SPL, it checks from SD and
 NAND.

Ok, I fail to grasp what is wanted from me. Shall I rework the patch somehow? 
How? Do we want m53evk_sd and m53evk_nand targets ?

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


Re: [U-Boot] [PATCH V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Fabio Estevam
On Sun, Apr 21, 2013 at 12:52 PM, Marek Vasut ma...@denx.de wrote:

 +u32 get_board_rev(void)
 +{
 +   struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
 +   struct fuse_bank *bank = iim-bank[0];
 +   struct fuse_bank0_regs *fuse =
 +   (struct fuse_bank0_regs *)bank-fuse_regs;
 +   int rev = readl(fuse-gp[6]);
 +
 +   return (get_cpu_rev()  ~(0xF  8)) | (rev  0xF)  8;

Do you really need to read the fuses on m53evk?

It would be better to do the same as we did for mx6:

Put it into a common mx5 file:

#ifdef CONFIG_REVISION_TAG
u32 __weak get_board_rev(void)
{
return get_cpu_rev();
}
#endif

,and then remove get_board_rev from your board file.

 +static void m53_set_nand(void)
 +{
 +   u32 i;
 +
 +   #define M4IF_GENP_WEIM_MM   0x0001
 +   #define WEIM_GCR2_MUX16_BYP_GRANT   0x1000

Please put these defines into a common file. mx53ard also uses them.

 +
 +   /* NAND flash is muxed on ATA pins */
 +   setbits_le32(M4IF_BASE_ADDR + 0xc, M4IF_GENP_WEIM_MM);
 +
 +   /* Wait for Grant/Ack sequence (see EIM_CSnGCR2:MUX16_BYP_GRANT) */
 +   for (i = 0x4; i  0x94; i += 0x18)
 +   clrbits_le32(WEIM_BASE_ADDR + i, WEIM_GCR2_MUX16_BYP_GRANT);
 +
 +   mxc_set_clock(0, 33, MXC_NFC_CLK);
 +   enable_nfc_clk(1);

Shouldn't this function be placed into a common mx5 location? mx53ard
uses the same.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] mxs: mxsboot: Move sdcard BCB header to 4 sectors offset

2013-04-24 Thread Otavio Salvador
The MX23 Boot ROM does blindly load from 2048 offset while the MX28
does parse the BCB header to known where to load the image from. We
move the BCB header to 4 sectors offset so same code can be used by
both SoCs avoiding code duplication.

This idea was given by Marek Vasut ma...@denx.de

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 tools/mxsboot.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 6c05aa4..d92c39f 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -551,7 +551,7 @@ static int mx28_create_sd_image(int infd, int outfd)
 
fsize = lseek(infd, 0, SEEK_END);
lseek(infd, 0, SEEK_SET);
-   size = fsize + 512;
+   size = fsize + 4 * 512;
 
buf = malloc(size);
if (!buf) {
@@ -559,7 +559,7 @@ static int mx28_create_sd_image(int infd, int outfd)
goto err0;
}
 
-   ret = read(infd, (uint8_t *)buf + 512, fsize);
+   ret = read(infd, (uint8_t *)buf + 4 * 512, fsize);
if (ret != fsize) {
ret = -1;
goto err1;
@@ -574,8 +574,8 @@ static int mx28_create_sd_image(int infd, int outfd)
cb-drv_info[0].chip_num = 0x0;
cb-drv_info[0].drive_type = 0x0;
cb-drv_info[0].tag = 0x1;
-   cb-drv_info[0].first_sector_number = sd_sector + 1;
-   cb-drv_info[0].sector_count = (size - 1) / 512;
+   cb-drv_info[0].first_sector_number = sd_sector + 4;
+   cb-drv_info[0].sector_count = (size - 4) / 512;
 
wr_size = write(outfd, buf, size);
if (wr_size != size) {
-- 
1.8.1

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


[U-Boot] [PATCH 2/2] mx53ard: Rework default environment to support FDT, MMC and netboot

2013-04-24 Thread Otavio Salvador
This reworks the environment settings to be aligned with the other
i.MX boards. The loadaddr has been changed to allow the Freescale
kernel and mainline kernel to work without environment changes.

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 include/configs/mx53ard.h | 101 +++---
 1 file changed, 78 insertions(+), 23 deletions(-)

diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index 148f7a2..339bf5a 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -90,6 +90,7 @@
 #include config_cmd_default.h
 
 #undef CONFIG_CMD_IMLS
+#define CONFIG_CMD_SETEXPR
 
 #define CONFIG_BOOTDELAY   3
 
@@ -100,45 +101,98 @@
 #define CONFIG_SMC911X_16_BIT
 #define CONFIG_SMC911X_BASE CS1_BASE_ADDR
 
-#define CONFIG_LOADADDR0x7080  /* loadaddr env var */
+#define CONFIG_LOADADDR0x7200  /* loadaddr env var */
 #define CONFIG_SYS_TEXT_BASE0x7780
 
+#define CONFIG_DEFAULT_FDT_FILEimx53-ard.dtb
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
script=boot.scr\0 \
uimage=uImage\0 \
-   mmcdev=0\0 \
-   mmcpart=2\0 \
-   mmcroot=/dev/mmcblk0p3 rw\0 \
-   mmcrootfstype=ext3 rootwait\0 \
-   mmcargs=setenv bootargs console=ttymxc0,${baudrate}  \
-   root=${mmcroot}  \
-   rootfstype=${mmcrootfstype}\0 \
+   console=ttymxc0\0 \
+   fdt_high=0x\0 \
+   initrd_high=0x\0 \
+   fdt_file= CONFIG_DEFAULT_FDT_FILE \0 \
+   fdt_addr=0x7100\0 \
+   boot_fdt=try\0 \
+   ip_dyn=yes\0 \
+   mmcdev= __stringify(CONFIG_SYS_MMC_ENV_DEV) \0 \
+   mmcpart= __stringify(CONFIG_SYS_MMC_ENV_PART) \0 \
+   mmcroot=/dev/mmcblk0p3 rootwait rw\0 \
+   update_sd_firmware_filename=u-boot.imx\0 \
+   update_sd_firmware= \
+   if test ${ip_dyn} = yes; then  \
+   setenv get_cmd dhcp;  \
+   else  \
+   setenv get_cmd tftp;  \
+   fi;  \
+   if mmc dev ${mmcdev}; then\
+   if ${get_cmd} ${update_sd_firmware_filename}; then  \
+   setexpr fw_sz ${filesize} / 0x200;  \
+   setexpr fw_sz ${fw_sz} + 1;   \
+   mmc write ${loadaddr} 0x2 ${fw_sz};  \
+   fi;   \
+   fi\0 \
+   mmcargs=setenv bootargs console=${console},${baudrate}  \
+   root=${mmcroot}\0 \
loadbootscript= \
fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0 \
bootscript=echo Running bootscript from mmc ...;  \
source\0 \
loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0 \
+   loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0 \
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
-   bootm\0 \
-   netargs=setenv bootargs console=ttymxc0,${baudrate}  \
+   if test ${boot_fdt} = yes || test ${boot_fdt} = try; then  \
+   if run loadfdt; then  \
+   bootm ${loadaddr} - ${fdt_addr};  \
+   else  \
+   if test ${boot_fdt} = try; then  \
+   bootm;  \
+   else  \
+   echo WARN: Cannot load the DT;  \
+   fi;  \
+   fi;  \
+   else  \
+   bootm;  \
+   fi;\0 \
+   netargs=setenv bootargs console=${console},${baudrate}  \
root=/dev/nfs  \
-   ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0 \
-   netboot=echo Booting from net ...;  \
+   ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0 \
+   netboot=echo Booting from net ...;  \
run netargs;  \
-   dhcp ${uimage}; bootm\0 \
-
-#define CONFIG_BOOTCOMMAND \
-   mmc dev ${mmcdev}; if mmc rescan; then  \
-   if run loadbootscript; then  \
-   run bootscript;  \
+   if test ${ip_dyn} = yes; then  \
+   setenv get_cmd dhcp;  \
else  \
-   if run loaduimage; then  \
-   run mmcboot;  \
-   else run netboot;  \
-   fi;  \
+   setenv get_cmd tftp;  \
fi;  \
-   else run netboot; fi
+   ${get_cmd} ${uimage};  \
+   if test ${boot_fdt} = yes || test ${boot_fdt} = try; then  \
+   if ${get_cmd} ${fdt_addr} ${fdt_file}; then  \
+   bootm ${loadaddr} - ${fdt_addr};  \
+   else  \
+   if test ${boot_fdt} = try; then  

Re: [U-Boot] [PATCH 1/2] mxs: mxsboot: Move sdcard BCB header to 4 sectors offset

2013-04-24 Thread Marek Vasut
Dear Otavio Salvador,

 The MX23 Boot ROM does blindly load from 2048 offset while the MX28
 does parse the BCB header to known where to load the image from. We
 move the BCB header to 4 sectors offset so same code can be used by
 both SoCs avoiding code duplication.
 
 This idea was given by Marek Vasut ma...@denx.de
 
 Signed-off-by: Otavio Salvador ota...@ossystems.com.br

What devices did you test this code on?

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


Re: [U-Boot] [PATCH V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Marek Vasut
Dear Fabio Estevam,

 On Sun, Apr 21, 2013 at 12:52 PM, Marek Vasut ma...@denx.de wrote:
  +u32 get_board_rev(void)
  +{
  +   struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
  +   struct fuse_bank *bank = iim-bank[0];
  +   struct fuse_bank0_regs *fuse =
  +   (struct fuse_bank0_regs *)bank-fuse_regs;
  +   int rev = readl(fuse-gp[6]);
  +
  +   return (get_cpu_rev()  ~(0xF  8)) | (rev  0xF)  8;
 
 Do you really need to read the fuses on m53evk?
 
 It would be better to do the same as we did for mx6:
 
 Put it into a common mx5 file:
 
 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
   return get_cpu_rev();
 }
 #endif
 
 ,and then remove get_board_rev from your board file.

We don't have that on MX5. Or do you mean I should do the work and submit this 
patch afterwards ?

  +static void m53_set_nand(void)
  +{
  +   u32 i;
  +
  +   #define M4IF_GENP_WEIM_MM   0x0001
  +   #define WEIM_GCR2_MUX16_BYP_GRANT   0x1000
 
 Please put these defines into a common file. mx53ard also uses them.

Which one? Or do you mean generate two files full of register sets because of 
these two bits?

  +
  +   /* NAND flash is muxed on ATA pins */
  +   setbits_le32(M4IF_BASE_ADDR + 0xc, M4IF_GENP_WEIM_MM);
  +
  +   /* Wait for Grant/Ack sequence (see EIM_CSnGCR2:MUX16_BYP_GRANT)
  */ +   for (i = 0x4; i  0x94; i += 0x18)
  +   clrbits_le32(WEIM_BASE_ADDR + i,
  WEIM_GCR2_MUX16_BYP_GRANT); +
  +   mxc_set_clock(0, 33, MXC_NFC_CLK);
  +   enable_nfc_clk(1);
 
 Shouldn't this function be placed into a common mx5 location? mx53ard
 uses the same.

The WEIM and M4IF configuration is board-specific.

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


Re: [U-Boot] [PATCH 1/2] mxs: mxsboot: Move sdcard BCB header to 4 sectors offset

2013-04-24 Thread Otavio Salvador
On Wed, Apr 24, 2013 at 6:29 PM, Marek Vasut ma...@denx.de wrote:
 Dear Otavio Salvador,

 The MX23 Boot ROM does blindly load from 2048 offset while the MX28
 does parse the BCB header to known where to load the image from. We
 move the BCB header to 4 sectors offset so same code can be used by
 both SoCs avoiding code duplication.

 This idea was given by Marek Vasut ma...@denx.de

 Signed-off-by: Otavio Salvador ota...@ossystems.com.br

 What devices did you test this code on?

MX23EVK and MX28EVK

--
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 V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Otavio Salvador
On Wed, Apr 24, 2013 at 6:32 PM, Marek Vasut ma...@denx.de wrote:
 Dear Fabio Estevam,

 On Sun, Apr 21, 2013 at 12:52 PM, Marek Vasut ma...@denx.de wrote:
  +u32 get_board_rev(void)
  +{
  +   struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
  +   struct fuse_bank *bank = iim-bank[0];
  +   struct fuse_bank0_regs *fuse =
  +   (struct fuse_bank0_regs *)bank-fuse_regs;
  +   int rev = readl(fuse-gp[6]);
  +
  +   return (get_cpu_rev()  ~(0xF  8)) | (rev  0xF)  8;

 Do you really need to read the fuses on m53evk?

 It would be better to do the same as we did for mx6:

 Put it into a common mx5 file:

 #ifdef CONFIG_REVISION_TAG
 u32 __weak get_board_rev(void)
 {
   return get_cpu_rev();
 }
 #endif

 ,and then remove get_board_rev from your board file.

 We don't have that on MX5. Or do you mean I should do the work and submit this
 patch afterwards ?

As a patch before this one, I'd say. No reason to add one more place
to change it later.

--
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/2] mxs: mxsboot: Move sdcard BCB header to 4 sectors offset

2013-04-24 Thread Fabio Estevam
On Wed, Apr 24, 2013 at 6:23 PM, Otavio Salvador
ota...@ossystems.com.br wrote:
 The MX23 Boot ROM does blindly load from 2048 offset while the MX28
 does parse the BCB header to known where to load the image from. We
 move the BCB header to 4 sectors offset so same code can be used by
 both SoCs avoiding code duplication.

 This idea was given by Marek Vasut ma...@denx.de

 Signed-off-by: Otavio Salvador ota...@ossystems.com.br

On mx23evk/mx28evk:

Tested-by: Fabio Estevam fabio.este...@freescale.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] mx53ard: Rework default environment to support FDT, MMC and netboot

2013-04-24 Thread Fabio Estevam
On Wed, Apr 24, 2013 at 6:23 PM, Otavio Salvador
ota...@ossystems.com.br wrote:
 This reworks the environment settings to be aligned with the other
 i.MX boards. The loadaddr has been changed to allow the Freescale
 kernel and mainline kernel to work without environment changes.

 Signed-off-by: Otavio Salvador ota...@ossystems.com.br

Looks good:

Acked-by: Fabio Estevam fabio.este...@freescale.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] mx5: Define a common get_board_rev()

2013-04-24 Thread Fabio Estevam
From: Fabio Estevam fabio.este...@freescale.com

When booting a FSL kernel based on 2.6.35 it is necessary to pass the revision
tag to the kernel.

Place a common weak function into soc.c for such purpose.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
 arch/arm/cpu/armv7/mx5/soc.c |7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/armv7/mx5/soc.c b/arch/arm/cpu/armv7/mx5/soc.c
index 263658a..3d50a5d 100644
--- a/arch/arm/cpu/armv7/mx5/soc.c
+++ b/arch/arm/cpu/armv7/mx5/soc.c
@@ -72,6 +72,13 @@ u32 get_cpu_rev(void)
return system_rev;
 }
 
+#ifdef CONFIG_REVISION_TAG
+u32 __weak get_board_rev(void)
+{
+   return get_cpu_rev();
+}
+#endif
+
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {
-- 
1.7.9.5

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


[U-Boot] [PATCH 2/3] mx5: Select CONFIG_REVISION_TAG

2013-04-24 Thread Fabio Estevam
From: Fabio Estevam fabio.este...@freescale.com

FSL 2.6.35 kernel expects that revision tag is passed by the bootloader.

Select CONFIG_REVISION_TAG so that mx53 boards can work properly with 2.6.35. 

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
 include/configs/mx53ard.h |1 +
 include/configs/mx53evk.h |1 +
 include/configs/mx53smd.h |1 +
 3 files changed, 3 insertions(+)

diff --git a/include/configs/mx53ard.h b/include/configs/mx53ard.h
index 148f7a2..296cae3 100644
--- a/include/configs/mx53ard.h
+++ b/include/configs/mx53ard.h
@@ -34,6 +34,7 @@
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index a0af3ee..822b926 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -34,6 +34,7 @@
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
 #define CONFIG_OF_LIBFDT
 
diff --git a/include/configs/mx53smd.h b/include/configs/mx53smd.h
index 9e83319..942949d 100644
--- a/include/configs/mx53smd.h
+++ b/include/configs/mx53smd.h
@@ -34,6 +34,7 @@
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN  (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
-- 
1.7.9.5

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


[U-Boot] [PATCH 3/3] mx53ard: Move register masks into imx-regs.h

2013-04-24 Thread Fabio Estevam
From: Fabio Estevam fabio.este...@freescale.com

imx-regs.h is more appropriate location for containing register masks. 

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
 arch/arm/include/asm/arch-mx5/imx-regs.h |2 ++
 board/freescale/mx53ard/mx53ard.c|2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h 
b/arch/arm/include/asm/arch-mx5/imx-regs.h
index a71cc13..6aff3be 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -267,6 +267,8 @@
 /* M4IF */
 #define M4IF_FBPM0 0x40
 #define M4IF_FIDBP 0x48
+#define M4IF_GENP_WEIM_MM_MASK 0x0001
+#define WEIM_GCR2_MUX16_BYP_GRANT_MASK 0x1000
 
 /* Assuming 24MHz input clock with doubler ON */
 /*MFI PDF */
diff --git a/board/freescale/mx53ard/mx53ard.c 
b/board/freescale/mx53ard/mx53ard.c
index 8d433a3..32c4d5f 100644
--- a/board/freescale/mx53ard/mx53ard.c
+++ b/board/freescale/mx53ard/mx53ard.c
@@ -62,8 +62,6 @@ void dram_init_banksize(void)
 static void setup_iomux_nand(void)
 {
u32 i, reg;
-   #define M4IF_GENP_WEIM_MM_MASK  0x0001
-   #define WEIM_GCR2_MUX16_BYP_GRANT_MASK  0x1000
 
reg = __raw_readl(M4IF_BASE_ADDR + 0xc);
reg = ~M4IF_GENP_WEIM_MM_MASK;
-- 
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 V2 6/6] arm: mx5: Add support for DENX M53EVK

2013-04-24 Thread Fabio Estevam
On Wed, Apr 24, 2013 at 6:32 PM, Marek Vasut ma...@denx.de wrote:

 We don't have that on MX5. Or do you mean I should do the work and submit this
 patch afterwards ?

To make things easier, I just sent a patch series that you can use :-)

 Which one? Or do you mean generate two files full of register sets because of
 these two bits?

No, my suggestion is just to put these 2 defines into imx-regs.h. This
is also part of my series I just sent.

  +
  +   /* NAND flash is muxed on ATA pins */
  +   setbits_le32(M4IF_BASE_ADDR + 0xc, M4IF_GENP_WEIM_MM);
  +
  +   /* Wait for Grant/Ack sequence (see EIM_CSnGCR2:MUX16_BYP_GRANT)
  */ +   for (i = 0x4; i  0x94; i += 0x18)
  +   clrbits_le32(WEIM_BASE_ADDR + i,
  WEIM_GCR2_MUX16_BYP_GRANT); +
  +   mxc_set_clock(0, 33, MXC_NFC_CLK);
  +   enable_nfc_clk(1);

 Shouldn't this function be placed into a common mx5 location? mx53ard
 uses the same.

 The WEIM and M4IF configuration is board-specific.

Right, understood. It seems like a duplication of code from mx53ard,
but anyway, what about:

clrbits_le32(WEIM_BASE_ADDR + i, WEIM_GCR2_MUX16_BYP_GRANT) ?

Accessing registers via offsets is not the best practice in U-boot.

What about the weim struct defined at arch/arm/include/asm/arch-mx5/imx-regs.h

for acessing such registers?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] mx53ard: Move register masks into imx-regs.h

2013-04-24 Thread Marek Vasut
Dear Fabio Estevam,

 From: Fabio Estevam fabio.este...@freescale.com
 
 imx-regs.h is more appropriate location for containing register masks.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

Thanks,

Acked-by: Marek Vasut ma...@denx.de

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 2/3] mx5: Select CONFIG_REVISION_TAG

2013-04-24 Thread Marek Vasut
Dear Fabio Estevam,

 From: Fabio Estevam fabio.este...@freescale.com
 
 FSL 2.6.35 kernel expects that revision tag is passed by the bootloader.
 
 Select CONFIG_REVISION_TAG so that mx53 boards can work properly with
 2.6.35.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

Acked-by: Marek Vasut ma...@denx.de

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


Re: [U-Boot] [PATCH 1/3] mx5: Define a common get_board_rev()

2013-04-24 Thread Marek Vasut
Dear Fabio Estevam,

 From: Fabio Estevam fabio.este...@freescale.com
 
 When booting a FSL kernel based on 2.6.35 it is necessary to pass the
 revision tag to the kernel.
 
 Place a common weak function into soc.c for such purpose.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

Acked-by: Marek Vasut ma...@denx.de

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 RESEND] arm: bootm: call udc_disable() before booting linux

2013-04-24 Thread Marek Vasut
Dear Mike Dunn,

 On the pxa270, if the udc device is not disabled before jumping to linux,
 the device fails to initialize in linux because it was left in a running
 state, and the linux driver assumes that it is in a disabled state.
 
 Signed-off-by: Mike Dunn miked...@newsguy.com

Applied this and the USB patch.

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 0/3] usb: ss: Fixes for super speed framework

2013-04-24 Thread Marek Vasut
Dear Vivek Gautam,

 This patch series fixes changes for Super speed framework
 which got pulled-in 'u-boot-usb/next'.
 First patch fixes Port Status and Port feature macro constants,
 then next patch parallelizes power-cycling of power on root-hub
 ports.
 3rd patch in this series also sync the min3/max3 definitions
 with Linux kernel.
 
 Based on u-boot-usb/next branch with following patch reverted:
 usb: hub: Reset only usb 2.0 ports

Fixed Julius's comment , applied and pushed.

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


Re: [U-Boot] ECCN code for uboot

2013-04-24 Thread takeshi.harada.hq

Dear Wolfgang-san

Thank you for your quick response!

Do you mean the U-Boot contains cryptographic algorithms
that makes 5D002?   

Harry



送信者: w...@denx.de
主題: [!]Re: [U-Boot] ECCN code for uboot
受信日: 2013/04/24 20:57:09
属性: なし

Dear Harry,

In message XNM2$7$1$4$$7$7$5$A$1011953u51779...@hitachi.com you wrote:
 
 I would like to know the ECCN code (Export control Classification code)
 for uboot 1.1.5.

There has never been any formal ECCN assignment for U-Boot - at least
none that I know of.  On the other hand, it is a a free Software
project that shares some code, some community and a lot of the
development methods with the Linux kernel and some distributions that
include and use these.  So it is eventually a pretty safe guess to use
the same ECCN.

For example, the Fedora Export Control Product Matrix at [1] uses
5D002 for the Fedora Linux distribution. The same ECCN is also used
by the Linux Foundation's Yocto Project [2] which includes U-Boot for
a number of board configurations.

So my best bet is that  5D002  is also a suitable ECCN for U-Boot.

But then - IANAL ...

[1] http://fedoraproject.org/wiki/Legal/Export
[2] https://www.yoctoproject.org/tools-resources/export-compliance


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Question: How does one get fresh air into a Russian church?
Answer:   One clicks on an icon, and a window opens!

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


Re: [U-Boot] [PATCH 0/3] usb: ss: Fixes for super speed framework

2013-04-24 Thread Vivek Gautam
Hi Marek,


On Thu, Apr 25, 2013 at 8:32 AM, Marek Vasut ma...@denx.de wrote:
 Dear Vivek Gautam,

 This patch series fixes changes for Super speed framework
 which got pulled-in 'u-boot-usb/next'.
 First patch fixes Port Status and Port feature macro constants,
 then next patch parallelizes power-cycling of power on root-hub
 ports.
 3rd patch in this series also sync the min3/max3 definitions
 with Linux kernel.

 Based on u-boot-usb/next branch with following patch reverted:
 usb: hub: Reset only usb 2.0 ports

 Fixed Julius's comment , applied and pushed.

Thanks :-)



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


[U-Boot] [PATCH 0/4] EXYNOS: Convert Assembly code to c and make it common.

2013-04-24 Thread Rajeshwari Shinde
Convert the assembly code in board/samsung to c and move the same to arch/arm.
lds file made common across SMDKV310, Origen and SMDK5250.
Add the power reset and exit wakeup api for exynos.
Initialise GPIO for uart in Origen and SMDK5250 using pinmux.

Rajeshwari Shinde (4):
  EXYNOS: Add API for power reset and exit wakeup
  EXYNOS: LDS file move to common
  EXYNOS4210: Configure GPIO for uart
  EXYNOS: Move files from board/samsung to arch/arm.

 arch/arm/cpu/armv7/exynos/Makefile |   14 +-
 .../arm/cpu/armv7/exynos}/clock_init.h |0
 arch/arm/cpu/armv7/exynos/clock_init_exynos4.c |   63 +++
 .../arm/cpu/armv7/exynos/clock_init_exynos5.c  |   26 +-
 arch/arm/cpu/armv7/exynos/common_setup.h   |   44 ++
 .../arm/cpu/armv7/exynos}/dmc_common.c |7 +-
 .../arm/cpu/armv7/exynos}/dmc_init_ddr3.c  |   17 +-
 arch/arm/cpu/armv7/exynos/dmc_init_exynos4.c   |  294 
 .../arm/cpu/armv7/exynos/exynos4_setup.h   |   72 +++-
 .../arm/cpu/armv7/exynos/exynos5_setup.h   |   53 +--
 arch/arm/cpu/armv7/exynos/lowlevel_init.c  |   72 +++
 arch/arm/cpu/armv7/exynos/pinmux.c |   40 ++
 arch/arm/cpu/armv7/exynos/power.c  |   50 ++
 .../arm/cpu/armv7/exynos}/spl_boot.c   |   90 +++-
 .../arm/cpu/armv7/exynos}/tzpc_init.c  |   17 +-
 arch/arm/include/asm/arch-exynos/power.h   |   10 +
 arch/arm/include/asm/arch-exynos/spl.h |1 +
 arch/arm/include/asm/arch-exynos/tzpc.h|   28 ++
 .../exynos-uboot-spl.lds}  |0
 board/samsung/origen/Makefile  |7 -
 board/samsung/origen/lowlevel_init.S   |  397 -
 board/samsung/origen/mem_setup.S   |  421 --
 board/samsung/origen/mmc_boot.c|   58 ---
 board/samsung/origen/origen.c  |   46 ++
 board/samsung/smdk5250/Makefile|9 -
 board/samsung/smdk5250/lowlevel_init.S |2 +
 board/samsung/smdkv310/Makefile|   10 +-
 board/samsung/smdkv310/lowlevel_init.S |  470 
 board/samsung/smdkv310/mem_setup.S |  365 ---
 board/samsung/smdkv310/mmc_boot.c  |   60 ---
 board/samsung/smdkv310/smdkv310.c  |   44 ++
 include/configs/exynos5250-dt.h|   14 +-
 include/configs/origen.h   |   10 +-
 include/configs/smdkv310.h |9 +-
 spl/Makefile   |4 +
 35 files changed, 921 insertions(+), 1903 deletions(-)
 rename {board/samsung/smdk5250 = arch/arm/cpu/armv7/exynos}/clock_init.h 
(100%)
 create mode 100644 arch/arm/cpu/armv7/exynos/clock_init_exynos4.c
 rename board/samsung/smdk5250/clock_init.c = 
arch/arm/cpu/armv7/exynos/clock_init_exynos5.c (97%)
 create mode 100644 arch/arm/cpu/armv7/exynos/common_setup.h
 rename {board/samsung/smdk5250 = arch/arm/cpu/armv7/exynos}/dmc_common.c (97%)
 rename {board/samsung/smdk5250 = arch/arm/cpu/armv7/exynos}/dmc_init_ddr3.c 
(96%)
 create mode 100644 arch/arm/cpu/armv7/exynos/dmc_init_exynos4.c
 rename board/samsung/origen/origen_setup.h = 
arch/arm/cpu/armv7/exynos/exynos4_setup.h (89%)
 rename board/samsung/smdk5250/setup.h = 
arch/arm/cpu/armv7/exynos/exynos5_setup.h (93%)
 create mode 100644 arch/arm/cpu/armv7/exynos/lowlevel_init.c
 rename {board/samsung/smdk5250 = arch/arm/cpu/armv7/exynos}/spl_boot.c (61%)
 rename {board/samsung/smdk5250 = arch/arm/cpu/armv7/exynos}/tzpc_init.c (81%)
 rename board/samsung/{smdk5250/smdk5250-uboot-spl.lds = 
common/exynos-uboot-spl.lds} (100%)
 delete mode 100644 board/samsung/origen/lowlevel_init.S
 delete mode 100644 board/samsung/origen/mem_setup.S
 delete mode 100644 board/samsung/origen/mmc_boot.c
 delete mode 100644 board/samsung/smdkv310/lowlevel_init.S
 delete mode 100644 board/samsung/smdkv310/mem_setup.S
 delete mode 100644 board/samsung/smdkv310/mmc_boot.c

-- 
1.7.4.4

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


[U-Boot] [PATCH 2/4] EXYNOS: LDS file move to common

2013-04-24 Thread Rajeshwari Shinde
smdk5250-uboot-spl.lds is moved to common folder, so that it can be reused.
It is renamed to exynos-uboot-spl.lds

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 .../exynos-uboot-spl.lds}  |0
 include/configs/exynos5250-dt.h|2 +-
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename board/samsung/{smdk5250/smdk5250-uboot-spl.lds = 
common/exynos-uboot-spl.lds} (100%)

diff --git a/board/samsung/smdk5250/smdk5250-uboot-spl.lds 
b/board/samsung/common/exynos-uboot-spl.lds
similarity index 100%
rename from board/samsung/smdk5250/smdk5250-uboot-spl.lds
rename to board/samsung/common/exynos-uboot-spl.lds
diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 4514e7a..03f896a 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -144,7 +144,7 @@
 #define COPY_BL2_FNPTR_ADDR0x02020030
 
 /* specific .lds file */
-#define CONFIG_SPL_LDSCRIPTboard/samsung/smdk5250/smdk5250-uboot-spl.lds
+#define CONFIG_SPL_LDSCRIPTboard/samsung/common/exynos-uboot-spl.lds
 #define CONFIG_SPL_TEXT_BASE   0x02023400
 #define CONFIG_SPL_MAX_FOOTPRINT   (14 * 1024)
 
-- 
1.7.4.4

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


[U-Boot] [PATCH 1/4] EXYNOS: Add API for power reset and exit wakeup

2013-04-24 Thread Rajeshwari Shinde
This patch adds APIs to get power reset status and exit the wakeup condition for
both exynos5 and exynos4

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/cpu/armv7/exynos/power.c|   50 ++
 arch/arm/include/asm/arch-exynos/power.h |   10 ++
 2 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/power.c 
b/arch/arm/cpu/armv7/exynos/power.c
index 6375a81..5d3bda2 100644
--- a/arch/arm/cpu/armv7/exynos/power.c
+++ b/arch/arm/cpu/armv7/exynos/power.c
@@ -140,3 +140,53 @@ void set_hw_thermal_trip(void)
setbits_le32(power-ps_hold_control, POWER_ENABLE_HW_TRIP);
}
 }
+
+static uint32_t exynos5_get_reset_status(void)
+{
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+
+   return power-inform1;
+}
+
+static uint32_t exynos4_get_reset_status(void)
+{
+   struct exynos4_power *power =
+   (struct exynos4_power *)samsung_get_base_power();
+
+   return power-inform1;
+}
+
+uint32_t get_reset_status(void)
+{
+   if (cpu_is_exynos5())
+   return exynos5_get_reset_status();
+   else
+   return  exynos4_get_reset_status();
+}
+
+static void exynos5_power_exit_wakeup(void)
+{
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+   typedef void (*resume_func)(void);
+
+   ((resume_func)power-inform0)();
+}
+
+static void exynos4_power_exit_wakeup(void)
+{
+   struct exynos4_power *power =
+   (struct exynos4_power *)samsung_get_base_power();
+   typedef void (*resume_func)(void);
+
+   ((resume_func)power-inform0)();
+}
+
+void power_exit_wakeup(void)
+{
+   if (cpu_is_exynos5())
+   exynos5_power_exit_wakeup();
+   else
+   exynos4_power_exit_wakeup();
+}
diff --git a/arch/arm/include/asm/arch-exynos/power.h 
b/arch/arm/include/asm/arch-exynos/power.h
index 3549667..98e1144 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -888,4 +888,14 @@ void set_ps_hold_ctrl(void);
  * source as XXTI
  */
 void set_xclkout(void);
+
+/*
+ *  Read inform1 to get the reset status
+ */
+uint32_t get_reset_status(void);
+
+/*
+ *  Read the resume function and call it
+ */
+void power_exit_wakeup(void);
 #endif
-- 
1.7.4.4

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


[U-Boot] [PATCH 3/4] EXYNOS4210: Configure GPIO for uart

2013-04-24 Thread Rajeshwari Shinde
This patch configures the gpio values for UART
on Origen and SMDKV310 using pinmux

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/cpu/armv7/exynos/pinmux.c |   40 +++
 board/samsung/origen/origen.c  |   46 
 board/samsung/smdkv310/smdkv310.c  |   44 ++
 include/configs/origen.h   |1 +
 include/configs/smdkv310.h |1 +
 5 files changed, 132 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index bd499b4..2042062 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -408,9 +408,49 @@ static int exynos4_mmc_config(int peripheral, int flags)
return 0;
 }
 
+static void exynos4_uart_config(int peripheral)
+{
+   struct exynos4_gpio_part1 *gpio1 =
+   (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1();
+   struct s5p_gpio_bank *bank;
+   int i, start, count;
+
+   switch (peripheral) {
+   case PERIPH_ID_UART0:
+   bank = gpio1-a0;
+   start = 0;
+   count = 4;
+   break;
+   case PERIPH_ID_UART1:
+   bank = gpio1-a0;
+   start = 4;
+   count = 4;
+   break;
+   case PERIPH_ID_UART2:
+   bank = gpio1-a1;
+   start = 0;
+   count = 4;
+   break;
+   case PERIPH_ID_UART3:
+   bank = gpio1-a1;
+   start = 4;
+   count = 2;
+   break;
+   }
+   for (i = start; i  start + count; i++) {
+   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
+   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
+   }
+}
 static int exynos4_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
+   case PERIPH_ID_UART0:
+   case PERIPH_ID_UART1:
+   case PERIPH_ID_UART2:
+   case PERIPH_ID_UART3:
+   exynos4_uart_config(peripheral);
+   break;
case PERIPH_ID_I2C0:
case PERIPH_ID_I2C1:
case PERIPH_ID_I2C2:
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index 638e7b1..b7dbb91 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -25,6 +25,8 @@
 #include asm/arch/cpu.h
 #include asm/arch/gpio.h
 #include asm/arch/mmc.h
+#include asm/arch/periph.h
+#include asm/arch/pinmux.h
 
 DECLARE_GLOBAL_DATA_PTR;
 struct exynos4_gpio_part1 *gpio1;
@@ -39,6 +41,50 @@ int board_init(void)
return 0;
 }
 
+static int board_uart_init(void)
+{
+   int err;
+
+   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART0 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART1 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART2 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART3 not configured\n);
+   return err;
+   }
+
+   return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+   int err;
+   err = board_uart_init();
+   if (err) {
+   debug(UART init failed\n);
+   return err;
+   }
+   return err;
+}
+#endif
+
 int dram_init(void)
 {
gd-ram_size= get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
diff --git a/board/samsung/smdkv310/smdkv310.c 
b/board/samsung/smdkv310/smdkv310.c
index 81ac8f6..805a894 100644
--- a/board/samsung/smdkv310/smdkv310.c
+++ b/board/samsung/smdkv310/smdkv310.c
@@ -137,3 +137,47 @@ int board_mmc_init(bd_t *bis)
return err;
 }
 #endif
+
+static int board_uart_init(void)
+{
+   int err;
+
+   err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART0 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART1 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART2 not configured\n);
+   return err;
+   }
+
+   err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE);
+   if (err) {
+   debug(UART3 not configured\n);
+   return err;
+   }
+
+   return 0;
+}
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+   int err;
+   err = board_uart_init();
+   if