Re: [U-Boot] [PATCH 1/2] at91: modified NAND flash timing on meesc board

2012-02-20 Thread Albert ARIBAUD

Hi Daniel,

Le 25/01/2012 14:19, Daniel Gorsulowski a écrit :

Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
---
  board/esd/meesc/meesc.c |8 
  1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c
index 4882ffc..9dd4375 100644
--- a/board/esd/meesc/meesc.c
+++ b/board/esd/meesc/meesc.c
@@ -73,20 +73,20 @@ static void meesc_nand_hw_init(void)
writel(csa,matrix-csa[0]);

/* Configure SMC CS3 for NAND/SmartMedia */
-   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
-   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(1) |
+   AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(2),
smc-cs[3].setup);

writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
smc-cs[3].pulse);

-   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   writel(AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(6),
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(3),
+   AT91_SMC_MODE_TDF_CYCLE(12),
smc-cs[3].mode);

/* Configure RDY/BSY */


Considered as a bug fix, and

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

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


Re: [U-Boot] [PATCH 2/2] at91: modified NAND flash timing on otc570 board

2012-02-20 Thread Albert ARIBAUD

Hi Daniel,

Le 25/01/2012 14:19, Daniel Gorsulowski a écrit :

Signed-off-by: Daniel Gorsulowskidaniel.gorsulow...@esd.eu
---
  board/esd/otc570/otc570.c |8 
  1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/esd/otc570/otc570.c b/board/esd/otc570/otc570.c
index 5dded41..0c12b66 100644
--- a/board/esd/otc570/otc570.c
+++ b/board/esd/otc570/otc570.c
@@ -81,20 +81,20 @@ static void otc570_nand_hw_init(void)
writel(csa,matrix-csa[0]);

/* Configure SMC CS3 for NAND/SmartMedia */
-   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
-   AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+   writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(1) |
+   AT91_SMC_SETUP_NRD(2) | AT91_SMC_SETUP_NCS_RD(2),
smc-cs[3].setup);

writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
smc-cs[3].pulse);

-   writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
+   writel(AT91_SMC_CYCLE_NWE(6) | AT91_SMC_CYCLE_NRD(6),
smc-cs[3].cycle);
writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
AT91_SMC_MODE_EXNW_DISABLE |
AT91_SMC_MODE_DBW_8 |
-   AT91_SMC_MODE_TDF_CYCLE(3),
+   AT91_SMC_MODE_TDF_CYCLE(12),
smc-cs[3].mode);

/* Configure RDY/BSY */


Considered as a bug fix, and

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

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


Re: [U-Boot] [PATCH v3 1/3] ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Heiko Schocher
Hello T Krishnamoorthy

T Krishnamoorthy, Balaji wrote:
 On Mon, Jan 23, 2012 at 3:14 PM, Patil, Rachna rac...@ti.com wrote:
 commit 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3
 Author: Patil, Rachna rac...@ti.com
 Date:   Sun Jan 22 23:44:12 2012 +

 ARM: I2C: I2C Multi byte address support

 Existing OMAP I2C driver does not support address
 length greater than one. Hence this patch is to
 add support for 2 byte address read/write.

 Signed-off-by: Philip, Avinash avinashphi...@ti.com
 Signed-off-by: Hebbar, Gururaja gururaja.heb...@ti.com
 Signed-off-by: Patil, Rachna rac...@ti.com
[...]
 wrong comment and typo
 This patch series is not really tested for other platform
 like (CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
 and the patch is buggy for OMAP4430 panda

:-(

Annoyingly this comment comes too late, as this patch series is in
mainline ... Can you (or Patil) fix this?

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 1/2] nios2-generic: Fix logic around choosing UART

2012-02-20 Thread Alex Hornung
 * Before, the normal altera UART driver was compiled in unconditionally
   and the JTAG UART was missed out.

 * Work around this by conditionalizing the driver to use based on the
   UART choice in the user's custom FPGA header file. If both were to be
   present, the JTAG UART would have preference.

Signed-off-by: Alex Hornung a...@alexhornung.com
---
 include/configs/nios2-generic.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index 9ba35e8..765b169 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -36,10 +36,11 @@
 /*
  * SERIAL
  */
-#define CONFIG_ALTERA_UART
 #if defined(CONFIG_ALTERA_JTAG_UART)
+# define CONFIG_ALTERA_JTAG_UART
 # define CONFIG_SYS_NIOS_CONSOLE   CONFIG_SYS_JTAG_UART_BASE
 #else
+# define CONFIG_ALTERA_UART
 # define CONFIG_SYS_NIOS_CONSOLE   CONFIG_SYS_UART_BASE
 #endif
 
-- 
1.7.3.4

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


[U-Boot] [PATCH 2/2] nios2: implement get_ticks and get_tbclk

2012-02-20 Thread Alex Hornung
 * Copy over Blackfin's get_ticks and get_tbclk - they work just fine on
   Nios2.

Signed-off-by: Alex Hornung a...@alexhornung.com
---
 arch/nios2/cpu/interrupts.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/nios2/cpu/interrupts.c b/arch/nios2/cpu/interrupts.c
index 0a97fa6..b7f1a05 100644
--- a/arch/nios2/cpu/interrupts.c
+++ b/arch/nios2/cpu/interrupts.c
@@ -98,6 +98,28 @@ ulong get_timer (ulong base)
return (timestamp - base);
 }
 
+/*
+ * This function is derived from Blackfin code (read timebase as long long).
+ * On Nios2 it just returns the timer value.
+ */
+unsigned long long get_ticks(void)
+{
+   return get_timer(0);
+}
+
+/*
+ * This function is derived from Blackfin code.
+ * On Nios2 it returns the number of timer ticks per second.
+ */
+ulong get_tbclk(void)
+{
+   ulong tbclk;
+
+   tbclk = CONFIG_SYS_HZ;
+   return tbclk;
+}
+
+
 /* The board must handle this interrupt if a timer is not
  * provided.
  */
-- 
1.7.3.4

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


Re: [U-Boot] [PATCH 1/2] nios2-generic: Fix logic around choosing UART

2012-02-20 Thread Alex Hornung
On 20/02/12 07:33, Alex Hornung wrote:
  * Before, the normal altera UART driver was compiled in unconditionally
and the JTAG UART was missed out.
 
  * Work around this by conditionalizing the driver to use based on the
UART choice in the user's custom FPGA header file. If both were to be
present, the JTAG UART would have preference.
 
 Signed-off-by: Alex Hornung a...@alexhornung.com
 ---
  include/configs/nios2-generic.h |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
 index 9ba35e8..765b169 100644
 --- a/include/configs/nios2-generic.h
 +++ b/include/configs/nios2-generic.h
 @@ -36,10 +36,11 @@
  /*
   * SERIAL
   */
 -#define CONFIG_ALTERA_UART
  #if defined(CONFIG_ALTERA_JTAG_UART)
 +# define CONFIG_ALTERA_JTAG_UART
  # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_JTAG_UART_BASE
  #else
 +# define CONFIG_ALTERA_UART
  # define CONFIG_SYS_NIOS_CONSOLE CONFIG_SYS_UART_BASE
  #endif
  


I'm sorry, I just messed this one up submitting a previous version that
wasn't ready.

Below is a new one:

From 8d616c75b4e45907d66de057146c7991deb442dc Mon Sep 17 00:00:00 2001
From: Alex Hornung a...@alexhornung.com
Date: Mon, 20 Feb 2012 07:26:18 +
Subject: [PATCH 1/1] nios2-generic: Fix logic around choosing UART

 * Before, the normal altera UART driver was compiled in unconditionally
   and the JTAG UART was missed out.

 * Work around this by conditionalizing the driver to use based on the
   UART choice in the user's custom FPGA header file. If both were to be
   present, the JTAG UART would have preference.

Signed-off-by: Alex Hornung a...@alexhornung.com
---
 include/configs/nios2-generic.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/configs/nios2-generic.h
b/include/configs/nios2-generic.h
index 9ba35e8..6f4d166 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -36,10 +36,11 @@
 /*
  * SERIAL
  */
-#define CONFIG_ALTERA_UART
-#if defined(CONFIG_ALTERA_JTAG_UART)
+#if defined(CONFIG_SYS_JTAG_UART_BASE)
+# define CONFIG_ALTERA_JTAG_UART
 # define CONFIG_SYS_NIOS_CONSOLE   CONFIG_SYS_JTAG_UART_BASE
 #else
+# define CONFIG_ALTERA_UART
 # define CONFIG_SYS_NIOS_CONSOLE   CONFIG_SYS_UART_BASE
 #endif

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


Re: [U-Boot] [PATCH V13 04/12] devkit8000/spl: init GPMC for dm9000 in SPL

2012-02-20 Thread Stefano Babic
On 19/02/2012 06:57, Thomas Weber wrote:
 Hello Stefano,

Hallo Thomas,
 +int spl_uboot_key(void);
 shouldn't this be spl_start_uboot ? The request if the key for starting
 u-boot is pressed?

It is - the prototype for spl_uboot_key is obsolete, I remove it for the
next version, thanks.

Stefano

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


Re: [U-Boot] [PATCH 0/2] i.mx28: Elimintated magic numbers for scratch register addresses

2012-02-20 Thread Marek Vasut
 Marek, Stefano,
 
 what kept you from accepting these patches? There was no objection on
 these.

The regs-digctl.h file being incomplete, it didn't contain all the bit 
definitions even though I shared the tool to convert file provided by FSL to 
uboot format.

M

 
 Matthias
 
 On 07.02.2012 15:08, rob...@delien.nl wrote:
  From: Robert Delien rob...@delien.nl
  
  This patch eliminates the use of magic numbers for the scratch register
  addresses. The registers in the DIGCTL sections are now defined and
  used to access the scratch registers.
  
  Robert Delien (2):
Added register definitions for DIGCTL registers
Replaced magic numbers for scratch register addresses with register

  definitions
   
   arch/arm/cpu/arm926ejs/mx28/mx28.c   |8 +-
   arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c   |8 +-
   arch/arm/include/asm/arch-mx28/imx-regs.h|1 +
   arch/arm/include/asm/arch-mx28/regs-digctl.h |  155
   ++ 4 files changed, 164 insertions(+), 8
   deletions(-)
   create mode 100644 arch/arm/include/asm/arch-mx28/regs-digctl.h
  
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] UBIFS: Improve error message when reading superblock failed

2012-02-20 Thread Bernhard Walle
In addition to the error message also display the error code. I had the
problem that my malloc memory was not enough (ENOMEM), and if u-boot
had displayed the error code immediately that would have saved me some
debugging.

Signed-off-by: Bernhard Walle wa...@corscience.de
---
v2: Print the non-negated error value.

 fs/ubifs/super.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26b48f0..e6c02f5 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1191,7 +1191,7 @@ int ubifs_mount(char *vol_name)
mnt = NULL;
ret = ubifs_get_sb(ubifs_fs_type, flags, name, data, mnt);
if (ret) {
-   printf(Error reading superblock on volume '%s'!\n, name);
+   printf(Error reading superblock on volume '%s': %d!\n, name, 
ret);
return -1;
}
 
-- 
1.7.9.1

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


Re: [U-Boot] [PATCH 0/2] i.mx28: Elimintated magic numbers for scratch register addresses

2012-02-20 Thread Matthias Fuchs
On 20.02.2012 09:32, Marek Vasut wrote:
 Marek, Stefano,

 what kept you from accepting these patches? There was no objection on
 these.
 
 The regs-digctl.h file being incomplete, it didn't contain all the bit 
 definitions even though I shared the tool to convert file provided by FSL to 
 uboot format.
Why must this file be absolute complete? It can be extended on need.
This just slows down development and as you might have noticed, that it
chases away some developers.

So accepting this patch is a first step. And hopefully the rest is added
sometimes later. If not, well, then nobody needs it and there's no need
to blow the headers.

Matthias


 
 M
 

 Matthias

 On 07.02.2012 15:08, rob...@delien.nl wrote:
 From: Robert Delien rob...@delien.nl

 This patch eliminates the use of magic numbers for the scratch register
 addresses. The registers in the DIGCTL sections are now defined and
 used to access the scratch registers.

 Robert Delien (2):
   Added register definitions for DIGCTL registers
   Replaced magic numbers for scratch register addresses with register
   
 definitions
  
  arch/arm/cpu/arm926ejs/mx28/mx28.c   |8 +-
  arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c   |8 +-
  arch/arm/include/asm/arch-mx28/imx-regs.h|1 +
  arch/arm/include/asm/arch-mx28/regs-digctl.h |  155
  ++ 4 files changed, 164 insertions(+), 8
  deletions(-)
  create mode 100644 arch/arm/include/asm/arch-mx28/regs-digctl.h

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


-- 

Dipl.-Ing. Matthias Fuchs
Head of System Design

esd electronic system design gmbh
Vahrenwalder Str. 207 - 30165 Hannover - GERMANY
Phone: +49-511-37298-0 - Fax: +49-511-37298-68
Please visit our homepage http://www.esd.eu
Quality Products - Made in Germany

Besuchen Sie uns auf der embedded world 2012
in Halle 4, Stand 129
vom 28. Februar - 01. März 2012 in Nürnberg!

Geschäftsführer: Klaus Detering
Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832
-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] UBIFS: Improve error message when reading superblock failed

2012-02-20 Thread Albert ARIBAUD

Hi Bernard,

Le 20/02/2012 09:44, Bernhard Walle a écrit :

In addition to the error message also display the error code. I had the
problem that my malloc memory was not enough (ENOMEM), and if u-boot
had displayed the error code immediately that would have saved me some
debugging.

Signed-off-by: Bernhard Wallewa...@corscience.de
---
v2: Print the non-negated error value.

  fs/ubifs/super.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26b48f0..e6c02f5 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1191,7 +1191,7 @@ int ubifs_mount(char *vol_name)
mnt = NULL;
ret = ubifs_get_sb(ubifs_fs_type, flags, name, data, mnt);
if (ret) {
-   printf(Error reading superblock on volume '%s'!\n, name);
+   printf(Error reading superblock on volume '%s': %d!\n, name, 
ret);
return -1;
}



Dry numbers as error messages are better than no error messages but only 
marginally IMO. Isn't there a way to emit a readable message re malloc 
instead of emitting an int value?


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


Re: [U-Boot] [PATCH] UBIFS: Improve error message when reading superblock failed

2012-02-20 Thread Bernhard Walle
Am 20.02.2012 09:59, schrieb Albert ARIBAUD:
 
 Dry numbers as error messages are better than no error messages but only 
 marginally IMO. Isn't there a way to emit a readable message re malloc 
 instead of emitting an int value?

Well, I'm not familiar with the u-boot codebase. Does u-boot have a
strerror table? How is it handled on other places? Should an error
message printed directly before returning -ENOMEM?



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


Re: [U-Boot] [PATCH 0/2] i.mx28: Elimintated magic numbers for scratch register addresses

2012-02-20 Thread Stefano Babic
On 20/02/2012 09:32, Marek Vasut wrote:
 Marek, Stefano,

 what kept you from accepting these patches? There was no objection on
 these.
 
 The regs-digctl.h file being incomplete, it didn't contain all the bit 
 definitions even though I shared the tool to convert file provided by FSL to 
 uboot format.

My point: most of files in u-boot can be considered incomplete, because
they do not define everything, but only what is *currently* used in U-boot.

I have not merged this patch because in the thread I read Robert wanted
to send an updated patch, and this made this version automatically obsolete.

I agree we can merge this patch - and we can always push later a patch
adding the bit definitions, when it will be necessary.

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-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] i.mx28: Added register definitions for DIGCTL registers

2012-02-20 Thread Stefano Babic
On 07/02/2012 15:08, rob...@delien.nl wrote:
 From: Robert Delien rob...@delien.nl
 
 This patch adds register definitions for the registers of the DIGCTL
 IP-block.
 
 Signed-off-by: Robert Delien rob...@delien.nl

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 2/2] i.mx28: Replaced magic numbers for scratch register addresses with register definitions

2012-02-20 Thread Stefano Babic
On 07/02/2012 15:08, rob...@delien.nl wrote:
 From: Robert Delien rob...@delien.nl
 
 This patch replaces the use of magice numbers for scratch register
 addresses with earlier defined register definitions.
 
 Signed-off-by: Robert Delien rob...@delien.nl
 ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

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


Re: [U-Boot] [v3 1/3] USB: Armada100: Add UTMI PHY interface driver

2012-02-20 Thread Ajay Bhargav

On Monday 13 February 2012 06:57 PM, Ajay Bhargav wrote:

This patch adds USB host controller's UTMI PHY interface driver for
Armada100 SOCs.

Signed-off-by: Ajay Bhargavajay.bhar...@einfochips.com
---
Changes for v2:
- Fix: enable only required clock in MPMU
Changes for v3:
- Added timeout on while loops
- moved utmi-armada100.h to arch include folder

  arch/arm/include/asm/arch-armada100/armada100.h|8 ++
  .../include/asm/arch-armada100/utmi-armada100.h|   79 
  drivers/usb/host/utmi-armada100.c  |   96 
  3 files changed, 183 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-armada100/utmi-armada100.h
  create mode 100644 drivers/usb/host/utmi-armada100.c


any comments on these patches?

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


Re: [U-Boot] [PATCH] UBIFS: Improve error message when reading superblock failed

2012-02-20 Thread Albert ARIBAUD

Hi Bernhard,

Le 20/02/2012 10:11, Bernhard Walle a écrit :

Am 20.02.2012 09:59, schrieb Albert ARIBAUD:


Dry numbers as error messages are better than no error messages but only
marginally IMO. Isn't there a way to emit a readable message re malloc
instead of emitting an int value?


Well, I'm not familiar with the u-boot codebase. Does u-boot have a
strerror table? How is it handled on other places? Should an error
message printed directly before returning -ENOMEM?


I don't think there is an strerror() API. But at least, if the newly 
printed int uses errno values, then instead of '... %d!, you could 
print ... errno=%d, which would give some hint to the reader.



Regards,
Bernhard


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


Re: [U-Boot] Unable to run scripts with autoscr command

2012-02-20 Thread Asif Sulikeri
Detlev Zundel dzu at denx.de writes:

Appreciate your reply Detlev, please find my replies in-line,

 what is the DM365-IPNC-1.0.14 version about?  I cannot see such a
 version (or tag) in mainline U-Boot.

I'm sorry for the typo that is supposed to be 1.0.1.


 
 So indeed, this cannot be in your version 1.3.4

Thanks for the confirmation,


 This is indeed the problem, the used shell is not powerful enough to do
 such scripting.  Using the hush shell will indeed solve the original
 problem.

Thanks for confirming the same,


 It seems that by changing your configuration somehow the increase in
 code size has broken the compilation.
 
 Did you see any errors or warnings while compiling?
 

There weren't any errors, and no related warnings while compiling and the code
compiled fine and also binary was created.

The resulting binary was of the size 157KB as compared to the usual 148KB, the
size did definitely increased there.


 On the other hand, davinci_dm365evm is a supported configuration in
 mainline, so why not try current code.  This way we would be in a much
 better position to help you.
 

I'll consider the suggestion, but since I've spent considerable time on this,
want to make sure where actually the problem lies.


 Thanks
   Detlev
 




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


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

2012-02-20 Thread Alexandre Belloni
Hi,

On Sat, Feb 18, 2012 at 05:21:46PM +0100, Albert ARIBAUD wrote :
 Also, doesn't this overallocate for U-Boot and seriously reduce the
 space available for Linux in Flash?
 

I did so on Marek's recommendation. Right now, u-boot's size for
AT91SAM9261EK is 235kB. I guess we can allocate a bit less.

My board has 8MB of dataflash, I couldn't find what size is available on
other evaluation kits...

Regards,

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


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

2012-02-20 Thread Albert ARIBAUD

Hi Alexandre,

Le 20/02/2012 11:40, Alexandre Belloni a écrit :

Hi,

On Sat, Feb 18, 2012 at 05:21:46PM +0100, Albert ARIBAUD wrote :

Also, doesn't this overallocate for U-Boot and seriously reduce the
space available for Linux in Flash?



I did so on Marek's recommendation. Right now, u-boot's size for
AT91SAM9261EK is 235kB. I guess we can allocate a bit less.

My board has 8MB of dataflash, I couldn't find what size is available on
other evaluation kits...


Hmm... With 8MByte FLASH the proposed mapping leaves 7+ MB for the 
flashed kernel, which should be enough :) so that's ok.



Regards,


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


Re: [U-Boot] [PATCH] arm:fix:cleanup: Volatile keyword removal

2012-02-20 Thread Lukasz Majewski
On Sat, 18 Feb 2012 12:19:23 +0100
Albert ARIBAUD albert.u.b...@aribaud.net wrote:

 Hi Lukasz,
 
 Le 18/10/2011 16:25, Lukasz Majewski a écrit :
  Volatile keyword removal from
  ./arch/arm/include/asm/bitops.h
 
  Signed-off-by: Lukasz Majewskil.majew...@samsung.com
  Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com
  ---
arch/arm/include/asm/bitops.h |6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
 
  diff --git a/arch/arm/include/asm/bitops.h
  b/arch/arm/include/asm/bitops.h index 879e20e..b00ae30 100644
  --- a/arch/arm/include/asm/bitops.h
  +++ b/arch/arm/include/asm/bitops.h
  @@ -25,11 +25,11 @@
/*
 * Function prototypes to keep gcc -Wall happy.
 */
  -extern void set_bit(int nr, volatile void * addr);
  +extern void set_bit(int nr, void *addr);
 
  -extern void clear_bit(int nr, volatile void * addr);
  +extern void clear_bit(int nr, void *addr);
 
  -extern void change_bit(int nr, volatile void * addr);
  +extern void change_bit(int nr, void *addr);
 
static inline void __change_bit(int nr, volatile void *addr)
{
 
 Going through backlogged patches adelegated to me, I found this one.
 I'm fine with it, however I notice there is absolutely no call to
 set_bit, change_bit or clear_bit in the whole ARM subtree... What is
 the point of removing only the volatile qualifier vs removing the
 function definitions?
 
 Amicalement,

Hi Albert,

This patch was a supplement (to quiet compiler warnings) to the USB
gadget infrastructure.

But as we know, usb:gadget hasn't been added to the u-boot mainline.

However, I'm working on this, so I predict, that in the (near) future I
would need those changes to suppress compiler warnings :-).

For now, the commit can be discarded, I will resubmit it if needed.

-- 
Best regards,

Lukasz Majewski

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


Re: [U-Boot] SRIO patches

2012-02-20 Thread Liu Gang
Hi, Andy,
Sorry for the late reply because of my mail system's problem.

On Mon, 2012-02-13 at 02:09 -0600, Andy Fleming wrote:
 1) I'm not convinced we need a MASTER build target. Isn't it
 possible to just add support for serving as an SRIO master, and to
 enable support from the command line, or via environment variable?

In principle, it's feasible to add support of MASTER feature from the
command line or environment variable. But the feature of Boot from SRIO
is a new and special function currently. So I think it may be better
don't compile the dependent code when we don't need this feature.
   
 2) There are a number of constants being defined that seem very much
 like system options (ie something that will vary with different
 chips):
 
 
 +#define SRIO_PORT_MAX_NUM2   /* SRIO port max number */
 +#define SRIO_OB_WIN_NUM  9   /* SRIO outbound window number */
 +#define SRIO_IB_WIN_NUM  5   /* SRIO inbound window number */
 +#define SRIO_MSG_UNIT_NUM2   /* SRIO message unit number */
 
 
 Maybe these should be config options?

Yes, I think your suggestion is better. I'll move these to
asm/fsl_srio.h file. Do you think this OK?

Best Regards,
Liu Gang


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


Re: [U-Boot] [PATCH 0/4 v5] i.MX28: Fix ref_cpu clock setup

2012-02-20 Thread Fabio Estevam
Hi Stefano,

On Mon, Feb 20, 2012 at 5:40 AM, Marek Vasut marek.va...@gmail.com wrote:

 Yea ... that issue is fixed. I acked patches 1,2,3 ... I'm still unsure about
 patch 4.

Can patches 1,2,3 be applied? They fix the kernel reset issue.

Thanks,

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


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

2012-02-20 Thread Alexandre Belloni
On at91sam platforms, u-boot grew larger than the allocated size in
dataflash, the layout was:
bootstrap  0x
ubootenv   0x4200
uboot  0x8400
kernel 0x00042000

u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
0x39C00 bytes anymore.

Now, the layout is:
bootstrap  0x
uboot  0x4000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel 0x0008C000

Signed-off-by: Alexandre Belloni alexandre.bell...@piout.net
---
 include/configs/at91sam9260ek.h |   18 --
 include/configs/at91sam9261ek.h |   18 --
 include/configs/at91sam9263ek.h |   10 +++---
 include/configs/at91sam9rlek.h  |   10 +++---
 4 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index db52ee6..b537760 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -185,10 +185,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH 1
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xC0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xC008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -199,10 +201,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS1 */
 #define CONFIG_ENV_IS_IN_DATAFLASH 1
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xD0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xD008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -231,6 +235,8 @@
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + 
sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP1
 #define CONFIG_CMDLINE_EDITING 1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 5140b26..fa461da 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -187,10 +187,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xC0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xC008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -201,10 +203,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS3 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xD0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define 

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

2012-02-20 Thread Alexandre Belloni
On Mon, Feb 20, 2012 at 11:46:58AM +0100, Albert ARIBAUD wrote :
 Hmm... With 8MByte FLASH the proposed mapping leaves 7+ MB for the
 flashed kernel, which should be enough :) so that's ok.
 

Ok then, I just prefixed the patch title with AT91SAM9*:

Regards,

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


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

2012-02-20 Thread Albert ARIBAUD

Hi Alexandre,

Le 20/02/2012 13:48, Alexandre Belloni a écrit :

On at91sam platforms, u-boot grew larger than the allocated size in
dataflash, the layout was:
bootstrap  0x
ubootenv   0x4200
uboot  0x8400
kernel 0x00042000

u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
0x39C00 bytes anymore.

Now, the layout is:
bootstrap  0x
uboot  0x4000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel 0x0008C000

Signed-off-by: Alexandre Bellonialexandre.bell...@piout.net
---


As this follows a V2 patch, you should post as V3 and with patch history 
(diffs from V3 to V2 and from V2 to V1) inserted here.



  include/configs/at91sam9260ek.h |   18 --
  include/configs/at91sam9261ek.h |   18 --
  include/configs/at91sam9263ek.h |   10 +++---
  include/configs/at91sam9rlek.h  |   10 +++---
  4 files changed, 38 insertions(+), 18 deletions(-)


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


[U-Boot] Flash not erased problem.

2012-02-20 Thread Sanjoy Saha - ERS, HCL Tech
Hi,
I am using u-Boot [2009.08-CanyonlandsOptimized_2.6.30_1.13-01] in 
canyonlands board to flash my ram file system (which I need to do often). I go 
in step to erase/tftp/copy the binary in my flash.

era 0xfc20 0xfd5f
tftp 0x20 canyonlands/ramdisk.img
cp.b ${fileaddr} 0xfc20 ${filesize}

other than copy command everything works fine. The copy command bails out with 
error message flash not erased. Size of ramdisk image is ~7MB.
I have verified the sectors for erase operation done properly (i.e filled with 
0x).

After giving 'n number of shot copy works great. I suspect timing problem 
which degrades with age of flash memory.
I have acquired a new board and i see the same problem.

Can some one help me out ?

Thank You
Sanjoy Saha

::DISCLAIMER::
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

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


Re: [U-Boot] [PATCH 0/4 v5] i.MX28: Fix ref_cpu clock setup

2012-02-20 Thread Marek Vasut
 Hi Stefano,
 
 On Mon, Feb 20, 2012 at 5:40 AM, Marek Vasut marek.va...@gmail.com wrote:
  Yea ... that issue is fixed. I acked patches 1,2,3 ... I'm still unsure
  about patch 4.
 
 Can patches 1,2,3 be applied? They fix the kernel reset issue.
 
 Thanks,
 
 Fabio Estevam

I'll apply and retest what's suitable tomorrow. Then I'll submit pullrq to 
stefano. We already decided on that.

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


[U-Boot] error compiling U-boot tools

2012-02-20 Thread Kopac Drago

Hallo


Just like to report problem when compiling U-boot tools

After building U-boot.bin wit h make -all
I tried to compile U-boot tools with
make env
or
make tools-all

It reports error:

fw_env.c: In function `flash_write_buf':
fw_env.c:860: error: `MTD_DATAFLASH' undeclared (first use in this function)
fw_env.c:860: error: (Each undeclared identifier is reported only once
fw_env.c:860: error: for each function it appears in.)
fw_env.c: In function `flash_read':
fw_env.c:979: error: `MTD_DATAFLASH' undeclared (first use in this function)
fw_env.c: In function `fw_env_open':
fw_env.c:1149: error: `MTD_DATAFLASH' undeclared (first use in this function)
gmake[2]: *** [fw_printenv] Error 1
Makefile:523: *** [env] Error 2



Adding definition of MTD_DATAFLASH
#define MTD_DATAFLASH 6
in
./tools/env/fw_env.c

which is defined in
./include/linux/mtd/mtd-abi.h

compiles ok.

From git repository the following commit can be seen:

Add support for dataflash to U-boot environment settings tool.



author   Remy Bohmer li...@bohmer.net

   Sat, 12 Feb 2011 18:06:26 
+ (19:06 +0100)

committer Wolfgang Denk w...@denx.de

   Tue, 12 Apr 2011 20:58:34 
+ (22:58 +0200)


Viel spas !





This e-mail and any attachments may contain confidential and/or privileged 
information and is intended solely for the addressee. Any unauthorised use, 
review, retransmissions, dissemination, copying or other use of this 
information by persons or entities other than the intended recipient is 
strictly prohibited.

To elektronsko sporo?ilo in vse morebitne priloge lahko vsebujejo informacije 
zaupne narave in so namenjene izklju?no naslovniku. Fizi?ni ali pravni osebi, 
ki ni naslovnik, je kakr?nakoli nepoobla??ena uporaba, pregledovanje, 
po?iljanje, raz?irjanje, kopiranje ali drug na?in razpolaganja z vsebino 
sporo?ila strogo prepovedana.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx6q: mx6qsabrelite: Update the README

2012-02-20 Thread Stefano Babic
On 13/02/2012 08:29, Dirk Behme wrote:
 The SD loader binary is now downloadable at
 
 https://wiki.linaro.org/Boards/MX6QSabreLite
 
 under a open-source 3-clause BSD license. Update the README
 for this.
 
 The discussion shows that it's hard to change the hardware
 regarding the default SPI NOR boot of the SabreLite boards.
 I.e. this will stay the default boot. Therefore remove the
 'early version of' statement.
 
 Signed-off-by: Dirk Behme dirk.be...@de.bosch.com
 CC: Stefano Babic sba...@denx.de
 CC: Jason Liu liu.h.ja...@gmail.com
 ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH v2 1/2] usb/ehci: Add USB support for the MX6Q

2012-02-20 Thread Stefano Babic
On 09/02/2012 09:33, Wolfgang Grandegger wrote:
 Currently, only USB Host 1 is supported.
 
 Cc: Remy Bohmer li...@bohmer.net
 Signed-off-by: Wolfgang Grandegger w...@denx.de
 ---

Applied to u-boot-imx (after rebasing), thanks.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH v2 2/2] mx6qsabrelite: add and enable USB Host 1 support

2012-02-20 Thread Stefano Babic
On 09/02/2012 09:33, Wolfgang Grandegger wrote:
 Cc: Stefano Babic sba...@denx.de
 Cc: Jason Liu jason@linaro.org
 Signed-off-by: Wolfgang Grandegger w...@denx.de
 ---

Applied to u-boot-imx (after rebasing), thanks.

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Aneesh V

On Saturday 18 February 2012 10:18 PM, Albert ARIBAUD wrote:

Hi Aneesh,



[...]


I will get back with more details on the Linaro GCC 2012.01 later.


I meant the Linaro GCC 2012.01 tool-chain problem

This is a different problem. Some of the .rodata symbols are given an
odd address although they should be aligned to at least 2-byte boundary
). In fact the data is actually put at the even address but the symbol's
value is +1 of the actual address. This is the ARM convention for Thumb
functions, but they have applied it here for data too. That's the
problem. I see that this doesn't happen to all the .rodata in SPL.
Neither could I reproduce it with a small program. But the workaround
for this problem is to avoid -fdata-sections. The following patch works
around it.

diff --git a/config.mk b/config.mk
index ddaa477..723286a 100644
--- a/config.mk
+++ b/config.mk
@@ -190,7 +190,7 @@ CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \

# Enable garbage collection of un-used sections for SPL
ifeq ($(CONFIG_SPL_BUILD),y)
-CPPFLAGS += -ffunction-sections -fdata-sections
+CPPFLAGS += -ffunction-sections
LDFLAGS_FINAL += --gc-sections
endif

Will you take a patch to make -fdata-sections optional, that is, having
it under something like CONFIG_SYS_SPL_NO_FDATA_SECTIONS?


Hmm... considering you're seeing the issue in a fairly new toolchain
release, I prefer notifying the toolchain makers, rather than removing
the -fdata-sections from SPL even for specific boards. Can you go and
see why the Linaro toolchain generated odd thumb data at all and get
this fixed?


I tried investigating a bit. As I mentioned earlier it doesn't happen
with some other files that use the same compiler and linker commands.
So, I don't know what's going on. Also, I couldn't reproduce it with a
simple program unlike in the other cases. Anyway, I have notified
tool-chain folks at Linaro:

http://article.gmane.org/gmane.linux.linaro.toolchain/2096

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


Re: [U-Boot] [PATCH v4] tools/env: add posibility to inject configuration

2012-02-20 Thread Andreas Bießmann
On 24.01.2012 10:10, Andreas Bießmann wrote:
 From: Andreas Bießmann biessm...@corscience.de
 
 If one want to use fw_printenv/fw_setenv in special variants (eg compiled in
 MTD parameters without configuration file) he need to change the sources.
 This patch add the posibillity to change the behaviour of fw_printenv by
 defining a specific configuration header at compile time.
 Therefore no need to patch the sources for special environment which fits
 better into automated build environments.
 
 Signed-off-by: Andreas Bießmann biessm...@corscience.de
 ---
 total: 0 errors, 0 warnings, 164 lines checked
 
 NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
 MULTISTATEMENT_MACRO_USE_DO_WHILE
 
 0001-tools-env-add-posibility-to-inject-configuration.patch has no obvious 
 style problems and is ready for submission.
 
 changes since v1:
  - use ?= style in Makefile as suggested by Mike
  - remove c++ style comments in header
 
 changes since v2:
  - place copied/generated fw_env_config.h in include/generated
  - adopt tools/env/Makefile to new placement of fw_env_config.h
 
 changes since v3:
  - add (C) header
  - generate empty config.h for unconfigured U-Boot tree
  - rebase
 
  tools/env/Makefile   |   29 +++---
  tools/env/fw_env.h   |   32 +++-
  tools/env/fw_env_config.h.in |   66 
 ++
  3 files changed, 95 insertions(+), 32 deletions(-)
  create mode 100644 tools/env/fw_env_config.h.in

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


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

2012-02-20 Thread Alexandre Belloni
On at91sam platforms, u-boot grew larger than the allocated size in
dataflash, the layout was:
bootstrap  0x
ubootenv   0x4200
uboot  0x8400
kernel 0x00042000

u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
0x39C00 bytes anymore.

Now, the layout is:
bootstrap  0x
uboot  0x4000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel 0x0008C000

Signed-off-by: Alexandre Belloni alexandre.bell...@piout.net
---
Changes for v2:
- changed the layout as per Marek's recommendation
Changes for v3:
- prefixed the patch title with AT91SAM9*:

 include/configs/at91sam9260ek.h |   18 --
 include/configs/at91sam9261ek.h |   18 --
 include/configs/at91sam9263ek.h |   10 +++---
 include/configs/at91sam9rlek.h  |   10 +++---
 4 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index db52ee6..b537760 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -185,10 +185,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH 1
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xC0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xC008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -199,10 +201,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS1 */
 #define CONFIG_ENV_IS_IN_DATAFLASH 1
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xD0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xD008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -231,6 +235,8 @@
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + 
sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP1
 #define CONFIG_CMDLINE_EDITING 1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 5140b26..fa461da 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -187,10 +187,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xC0042000 0x2200 0x21; bootm
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND cp.b 0xC008C000 0x2200 0x21; bootm
 #define CONFIG_BOOTARGSconsole=ttyS0,115200  
\
root=/dev/mtdblock0   \
mtdparts=atmel_nand:-(root)   \
@@ -201,10 +203,12 @@
 /* bootstrap + u-boot + env + linux in dataflash on CS3 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
 #define CONFIG_ENV_ADDR(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND cp.b 0xD0042000 0x2200 0x21; 

Re: [U-Boot] [PATCH 04/17] OMAP5: emif/ddr: Change emif settings as required for ES1.0 silicon.

2012-02-20 Thread Tom Rini
On Fri, Feb 17, 2012 at 05:35:20PM +0530, R Sricharan wrote:

 The OMAP5 silicon has new DDR PHY design, which includes a external PHY
 as well. So configuring the ext PHY parameters here. Also the EMIF timimg
 registers and a couple of DDR mode registers needs to be updated based on
 the testing from the actual silicon.
[snip]
 + /* external phy 6-24 registers do not change with
 +  * ddr frequency

Here and elsewhere, incorrectly styled comments.

[snip]
  /* Maximum delay before Low Power Modes */
 +#ifndef CONFIG_OMAP54XX
  #define REG_CS_TIM   0xF
 +#else
 +#define REG_CS_TIM  0x0
 +#endif

You used spaces not tabs and I think checkpatch will note that for you
as well (so I expect v2 of the series to be checkpatch clean, aside from
80char wide stuff in those tables).

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


Re: [U-Boot] [PATCH 15/17] power: twl6035: add palmas PMIC support

2012-02-20 Thread Tom Rini
On Fri, Feb 17, 2012 at 05:35:31PM +0530, R Sricharan wrote:

 From: Balaji T K balaj...@ti.com
 
 palmas/TWL6035 is power IC for omap5 evm boards
 
 Signed-off-by: Balaji T K balaj...@ti.com
[snip]
 +++ b/drivers/power/twl6035.c
[snip]
 +#ifdef CONFIG_TWL6035_POWER

Don't need to do that since we only link this file when that is set.

 +/* Functions to read and write from TWL6030 */
 +int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg)
 +{
 + return i2c_write(chip_no, reg, 1, val, 1);
 +}
 +
 +int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
 +{
 + return i2c_read(chip_no, reg, 1, val, 1);
 +}

Used, exported, OK.

 +/* To align with i2c mw/mr address, reg, val command syntax */
 +static inline int palmas_write_u8(u8 chip_no, u8 reg, u8 val)
 +{
 + return i2c_write(chip_no, reg, 1, val, 1);
 +}
 +
 +static inline int palmas_read_u8(u8 chip_no, u8 reg, u8 *val)
 +{
 + return i2c_read(chip_no, reg, 1, val, 1);
 +}

Unused and static so this must have warned.  To be clear, I expect the
patch series to add no more warnings for omap5_evm.  Thanks!

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


Re: [U-Boot] [PATCH 16/17] omap5: pbias ldo9 turn on

2012-02-20 Thread Tom Rini
On Fri, Feb 17, 2012 at 05:35:32PM +0530, R Sricharan wrote:

 From: Balaji T K balaj...@ti.com
 
 Add omap5 pbias configuration for mmc1/sd lines
 and set voltage for sd data i/o lines
 
 Signed-off-by: Balaji T K balaj...@ti.com

[snip]
 diff --git a/drivers/power/twl6035.c b/drivers/power/twl6035.c
 index 978a7ad..878117e 100644
 --- a/drivers/power/twl6035.c
 +++ b/drivers/power/twl6035.c
 @@ -51,4 +51,18 @@ void twl6035_init_settings(void)
  {
   return;
  }
 +
 +void twl6035_mmc1_poweron_ldo(void)
 +{
 + u8 val = 0;
 +
 + /* set LDO9 TWL6035 to 3V */
 + val = 0x2b; /* (3 -.9)*28 +1 */
 + palmas_write_u8(0x48, LDO9_VOLTAGE, val);
 +
 + /* TURN ON LDO9 */
 + val = LDO_ON | LDO_MODE_SLEEP | LDO_MODE_ACTIVE;
 + palmas_write_u8(0x48, LDO9_CTRL, val);
 + return;
 +}

This is when we should add those two previous inlines.  Please use
git test-sequence to make sure the series is clean, thanks.

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


Re: [U-Boot] error compiling U-boot tools

2012-02-20 Thread Mike Frysinger
On Monday 20 February 2012 09:23:00 Kopac Drago wrote:
 I tried to compile U-boot tools with
 make env
 or
 make tools-all
 
 It reports error:
 
 fw_env.c: In function `flash_write_buf':
 fw_env.c:860: error: `MTD_DATAFLASH' undeclared (first use in this
 function)

the kernel headers installed in your host system are out of date.  looking at 
the kernel history, it seems they're *very* old as MTD_DATAFLASH was added in 
Feb 2005.  i could understand making concessions for semi-recent additions, 
but not for something this old.

not a bug in u-boot ... update your distro's kernel headers.
-mike


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


Re: [U-Boot] Flash not erased problem.

2012-02-20 Thread Stefan Roese
Hi Sanjoy,

On Monday 20 February 2012 13:40:30 Sanjoy Saha - ERS, HCL Tech wrote:
 I am using u-Boot [2009.08-CanyonlandsOptimized_2.6.30_1.13-01] in
 canyonlands board to flash my ram file system (which I need to do often).
 I go in step to erase/tftp/copy the binary in my flash.
 
 era 0xfc20 0xfd5f
 tftp 0x20 canyonlands/ramdisk.img
 cp.b ${fileaddr} 0xfc20 ${filesize}
 
 other than copy command everything works fine. The copy command bails out
 with error message flash not erased. Size of ramdisk image is ~7MB. I
 have verified the sectors for erase operation done properly (i.e filled
 with 0x).
 
 After giving 'n number of shot copy works great. I suspect timing problem
 which degrades with age of flash memory. I have acquired a new board and i
 see the same problem.
 
 Can some one help me out ?
 
Did you check upgrading to a newer U-Boot version? Take a look at
this commit:

Author: Stefan Roese s...@denx.de  2009-10-29 18:37:45
Committer: Stefan Roese s...@denx.de  2009-11-09 13:30:19
Parent: 514bab6609acd1a2a19fdd75c2f6255178db7c96 (ppc4xx: Fix chip_config 
command for AMCC 
Arches)
Child:  17a684449728ce4c9ce79fa9e7e75b86a5f9b41d (ppc4xx/Canyonlands added USB 
board 
callbacks)
Branches: many (141)
Follows: v2009.11-rc1
Precedes: v2009.11-rc2

ppc4xx: Canyonlands: Change EBC bus config to drive always (no high-z)

This patch fixes a problem only seen very occasionally on Canyonlands.
The NOR flash interface (CFI driver) doesn't work reliably in all cases.
Erasing and/or programming sometimes doesn't work. Sometimes with
an error message, like flash not erased when trying to program an
area that should have just been erased. And sometimes without any error
messages. As mentioned above, this problem was only seen rarely and with
some PLL configuration (CPU speed, EBC speed).

Now I spotted this problem a few times, when running my Canyonlands with
the following setup (chip_config):

1000-nor - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100

Changing the EBC configuration to not release the bus into high
impedance state inbetween the transfers (ATC, DTC and CTC bits set to 1
in EBC0_CFG) seems to fix this problem. I haven't seen any failure
anymore with this patch applied.

Signed-off-by: Stefan Roese s...@denx.de


So a newer U-Boot version should fix your issue.

Best regards,
Stefan

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


[U-Boot] u-boot-2011.12-r3 build fails without CONFIG_CMD_NET

2012-02-20 Thread Maxim Podbereznyy
Hi!

I found that if CONFIG_CMD_NET is undefined in a config file then the build
is broken. Tested for Beagleboard and Overo.

net/libnet.o: In function `rpc_req':
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:193:
undefined reference to `NetEthHdrSize'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:202:
undefined reference to `NetSendUDPPacket'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:203:
undefined reference to `NetTxPacket'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:203:
undefined reference to `NetServerEther'
net/libnet.o: In function `NfsTimeout':
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:574:
undefined reference to `NetStartAgain'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:577:
undefined reference to `NetSetTimeout'
net/libnet.o: In function `nfs_read_reply':
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:563:
undefined reference to `NetBootFileXferSize'
net/libnet.o: In function `NfsHandler':
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:656:
undefined reference to `NetSetTimeout'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:668:
undefined reference to `NetState'
net/libnet.o: In function `NfsStart':
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:717:
undefined reference to `eth_get_name'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:739:
undefined reference to `NetSetTimeout'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:740:
undefined reference to `NetSetHandler'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetServerIP'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `BootFile'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetOurIP'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetOurGatewayIP'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetOurSubnetMask'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetBootFileSize'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/3.0.17/u-boot-2011.12-r3/git/net/nfs.c:752:
undefined reference to `NetServerEther'
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/sysroots/i686-linux/usr/bin/armv7a-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-ld:
BFD (GNU Binutils) 2.20.1.20100303 assertion fail
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/binutils-cross-2.20.1-r9/binutils-2.20.1/bfd/elf32-arm.c:12191
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/sysroots/i686-linux/usr/bin/armv7a-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-ld:
BFD (GNU Binutils) 2.20.1.20100303 assertion fail
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/binutils-cross-2.20.1-r9/binutils-2.20.1/bfd/elf32-arm.c:12191
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/sysroots/i686-linux/usr/bin/armv7a-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-ld:
BFD (GNU Binutils) 2.20.1.20100303 assertion fail
/home/maxx/OE/setup-scripts/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/binutils-cross-2.20.1-r9/binutils-2.20.1/bfd/elf32-arm.c:12191

Re: [U-Boot] u-boot-2011.12-r3 build fails without CONFIG_CMD_NET

2012-02-20 Thread Tom Rini

On 02/20/2012 11:20 AM, Maxim Podbereznyy wrote:

Hi!

I found that if CONFIG_CMD_NET is undefined in a config file then the build
is broken. Tested for Beagleboard and Overo.


Correct, you also need to undefine CONFIG_CMD_NFS.

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


Re: [U-Boot] [PATCH 0/9] Fix a few warnings that bug me

2012-02-20 Thread Simon Glass
Hi Wolfgang / Stefano,

On Thu, Jan 5, 2012 at 10:28 PM, Simon Glass s...@chromium.org wrote:
 Hi Wolfgang,

 On Thu, Jan 5, 2012 at 10:20 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,

 In message 1325822097-15227-1-git-send-email-...@chromium.org you wrote:
 This series fixes some warnings which seem to still be left over from
 all the warning-squashing efforts for 2011.12. If patches exist for some
 of these already then please ignore.

 The alias problem in USB is a bit odd, since I thought it was already
 fixed. But perhaps it has come back.

 Can you please let me know which tool chain is throwing these errors?
 I built master yesterday, and before adding the commit that
 introduced the ``_LINUX_CONFIG_H redefined'' issue the PPC tree was
 built clean - with ELDK 4.2 (gcc 4.2.2), ELDK 5.1 (gcc 4.6.1) and with
 ELDK 5.2 (gcc 4.6.3).

 I just check that - actually my PowerPC one is v4.4.4:

 Using built-in specs.
 Target: powerpc-linux
 Configured with: /home/tony/buildall/src/gcc/configure
 --target=powerpc-linux --enable-targets=all
 --prefix=/opt/cross/gcc-4.4.4-nolibc/powerpc-linux/
 --enable-languages=c --with-newlib --without-headers
 --enable-sjlj-exceptions --with-system-libunwind --disable-nls
 --disable-threads --disable-shared --disable-libmudflap
 --disable-libssp --disable-libgomp --disable-decimal-float
 --enable-checking=release --with-mpfr=/home/tony/buildall/src/sys
 --with-gmp=/home/tony/buildall/src/sys
 Thread model: single
 gcc version 4.4.4 (GCC)

 I got this from Mike F (from the Gentoo site).


What should we do about this series? I still see these warnings with
the toolchains I use [1]. Does anyone else?

Regards,
Simon

[1] http://dev.gentoo.org/~vapier/u-boot/

 Regards,
 Simon


 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
 Documentation is like sex: when it is good, it is  very,  very  good;
 and when it is bad, it is better than nothing.         - Dick Brandon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM:OMAP+:MMC: Add parameters to MMC init

2012-02-20 Thread Tom Rini
On Fri, Feb 17, 2012 at 04:33:05PM -0800, Jonathan Solnit wrote:

 Adds parameters to the OMAP MMC initialization function so the board
 can mask host capabilities and set the maximum clock frequency. While
 the OMAP supports a certain set of MMC host capabilities, individual
 boards may be more restricted.  In particular, if the clock is set
 faster than the board can handle there will not be rail-to-rail swing
 at the card.

So, this is for a not yet (but I believe the intention is to post soon)
mainline board.  My concern here is that a given bad SD card would /
should show the problem on any board, so we should be adjusting our
caps globally, yes?  Or is there a board (and not SoC) specific part
of the equation?  Thanks!

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


Re: [U-Boot] [PATCH] lsxl: add support for lschlv2 and lsxhl

2012-02-20 Thread Michael Walle
Hi Wolfgang,

Am Dienstag 03 Januar 2012, 15:46:09 schrieb Wolfgang Denk:
  The linkstations don't have a (populated) serial port. There is no way to
  access an unmodified board other than using the netconsole. If you want
  to recover from a bad environment setting or an empty environment, you
  can do this only with a working network connection.
 
 I understand they have USB?  Can we use console over USB instead?

sorry for digging out an old thread ;)

Unfortunately newer linkstations haven't even usb ports populated. Would you 
accept a special rescue mode, in which there is a fixed (hardcoded) mac 
address and fixed IP settings. This mode would be enabled by pressing a button 
for some time upon startup.


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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Tom Rini
On Sun, Feb 19, 2012 at 02:15:30AM -0500, Mike Frysinger wrote:
 On Saturday 18 February 2012 17:03:59 Simon Glass wrote:
  On Wed, Feb 15, 2012 at 5:57 AM, Aneesh V wrote:
   -.globl reset_cpu
   +.type  reset_cpu, %function
   +.globalreset_cpu
  
  Should we introduce a macro to deal with this rather than writing it
  out each time? EXPORT()?
 
 we have it already with the linux/linkage.h header :)

Well, unless my tree is out of date (or stuff is in-flight) we don't
have the full compliment here.  We have linux/linkage.h for all and
asm/linkage.h for bfin.  That said, yes, we should grab at least the
ARM version and make use of ENTRY/END_FUNC ala the kernel.  I'm behind
on my convert __attribute__((...)) to __attr series already or I'd say
more :)

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


[U-Boot] [PATCH] nand: reinstate lazy bad block scanning

2012-02-20 Thread Scott Wood
commit 2a8e0fc8b3dc31a3c571e439fbf04b882c8986be (nand: Merge changes
from Linux nand driver) accidentally reverted commit
13f0fd94e3cae6f8a0d9fba5d367e311edc8ebde (NAND: Scan bad blocks
lazily.).

Reinstate the change, as amended by commit
ff49ea8977b56916edd5b1766d9939010e30b181 (NAND: Mark the BBT as scanned
prior to calling scan_bbt.).

Signed-off-by: Scott Wood scottw...@freescale.com
---
 drivers/mtd/nand/nand_base.c |   10 +++---
 include/linux/mtd/nand.h |2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8ab8303..44f7b91 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -479,6 +479,11 @@ static int nand_block_checkbad(struct mtd_info *mtd, 
loff_t ofs, int getchip,
 {
struct nand_chip *chip = mtd-priv;
 
+   if (!(chip-options  NAND_BBT_SCANNED)) {
+   chip-options |= NAND_BBT_SCANNED;
+   chip-scan_bbt(mtd);
+   }
+
if (!chip-bbt)
return chip-block_bad(mtd, ofs, getchip);
 
@@ -3166,10 +3171,9 @@ int nand_scan_tail(struct mtd_info *mtd)
 
/* Check, if we should skip the bad block table scan */
if (chip-options  NAND_SKIP_BBTSCAN)
-   return 0;
+   chip-options |= NAND_BBT_SCANNED;
 
-   /* Build bad block table */
-   return chip-scan_bbt(mtd);
+   return 0;
 }
 
 /**
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 99668d5..da6fa18 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -232,6 +232,8 @@ typedef enum {
 #define NAND_CREATE_EMPTY_BBT  0x0100
 
 /* Options set by nand scan */
+/* bbt has already been read */
+#define NAND_BBT_SCANNED   0x4000
 /* Nand scan has allocated controller struct */
 #define NAND_CONTROLLER_ALLOC  0x8000
 
-- 
1.7.7.rc3.4.g8d714

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


Re: [U-Boot] [PATCH] [v2] mtd/nand: Fix IFC driver to support 2K NAND page

2012-02-20 Thread Scott Wood
On Fri, Jan 20, 2012 at 06:39:05PM +0530, Prabhakar Kushwaha wrote:
 1) OOB area should be updated irrespective of NAND page size. Earlier it was
 updated only for 512byte NAND page.
 
 2) During OOB update fbcr should be equal to OOB size.
 
 Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
 Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
 ---
  Based upon git://git.denx.de/u-boot.git (branch master)
 
  Changes for v2- Incorporated Scott's comments from linuxppc-dev mailing list
http://patchwork.ozlabs.org/patch/135010/
   - Added missed NAND_CMD_READOOB
   - Updated function as per Scott's advice 
 
 
  drivers/mtd/nand/fsl_ifc_nand.c |   27 +--
  1 files changed, 13 insertions(+), 14 deletions(-)

Applied to u-boot-nand-flash

-Scott

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


Re: [U-Boot] [PATCH] mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_command

2012-02-20 Thread Scott Wood
On Fri, Jan 20, 2012 at 06:38:14PM +0530, Prabhakar Kushwaha wrote:
 Freescale IFC NAND Machine calculates ECC on 512byte sector and same is used 
 in
 fsl_ifc_run_command() during ECC status verification. Also this sector is 
 passed
 to is_blank() for blank checking. It is wrong at first place because
 is_blank()'s implementation checks for Page size and OOB area size. 
 is_blank() should be called per page for main and OOB area verification.
 
 Variables name are redefined to avoid confusion between buffer and ecc sector.
 
 Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com
 Signed-off-by: Scott Wood scottw...@freescale.com
 Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
 ---
  Applied upon git://git.denx.de/u-boot.git (branch master)
 
  This patch is based upon ifc driver patch in linuxppc-dev mailing list
  http://patchwork.ozlabs.org/patch/136547/
 
  It is a replacement of my earlier patch 
   mtd/nand:Fix wrong address read in is_blank()
  http://patchwork.ozlabs.org/patch/133388/ 
 
 
  drivers/mtd/nand/fsl_ifc_nand.c |   52 
 +--
  1 files changed, 28 insertions(+), 24 deletions(-)

Applied to u-boot-nand-flash...

 + /*
 +  * Uncorrectable error.
 +  * OK only if the whole page is blank.
 +  *
 +  * We disable ECCER reporting due to...
 +  * erratum IFC-A002770 -- so report it now if we
 +  * see an uncorrectable error in ECCSTAT.
 +  */

...with the ... removed from the comment.

-Scott

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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Simon Glass
Hi Tom, Aneesh,

On Mon, Feb 20, 2012 at 12:07 PM, Tom Rini tr...@ti.com wrote:
 On Sun, Feb 19, 2012 at 02:15:30AM -0500, Mike Frysinger wrote:
 On Saturday 18 February 2012 17:03:59 Simon Glass wrote:
  On Wed, Feb 15, 2012 at 5:57 AM, Aneesh V wrote:
   -.globl reset_cpu
   +.type  reset_cpu, %function
   +.global        reset_cpu
 
  Should we introduce a macro to deal with this rather than writing it
  out each time? EXPORT()?

 we have it already with the linux/linkage.h header :)

 Well, unless my tree is out of date (or stuff is in-flight) we don't
 have the full compliment here.  We have linux/linkage.h for all and
 asm/linkage.h for bfin.  That said, yes, we should grab at least the
 ARM version and make use of ENTRY/END_FUNC ala the kernel.  I'm behind
 on my convert __attribute__((...)) to __attr series already or I'd say
 more :)

In case one of you is going to look at this, can we try to use
asm-generic as much as possible?


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

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


Re: [U-Boot] [PATCH v3 1/3] ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Tom Rini
On Sun, Feb 19, 2012 at 10:44:52AM +0100, Thomas Weber wrote:
 Hello Tom, hello Rachna,
 
 I don't know if this is related to the i2c changes or mmc changes?
 
 When I boot from nand and then make mmc rescan the card is not detected.
 When booting with boot_key on Devkit8000 directly from sd-card
 everything is okay.

It's the i2c changes, I'm fairly certain.

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


Re: [U-Boot] [PATCH v3 0/6] Introduce generic relocation feature

2012-02-20 Thread Simon Glass
Hi Albert,

On Fri, Feb 3, 2012 at 2:06 PM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Simon,

 Le 18/01/2012 20:31, Simon Glass a écrit :

 [+TI maintainers, tx25 board maintainer]

 Hi Albert,


 For ARM, a new arch/arm/lib/proc.S file is created, which holds generic
 ARM assembler code (things that cannot be written in C and are common
 functions used by all ARM CPUs). This helps reduce duplication.
 Interrupt
 handling code and perhaps even some startup code can move there later.

 It may be useful for other architectures with a lot of different CPUs
 to have a similar file.


 NAK for several reasons:


 I think you are NAKing the 'arm: Add processor function library'
 patch out of the series:


 Yes. Wasn't that clear?


It would be better if you NAKed the specific patch, but anyway, I
understood what you meant.


 Create reloc.h and include it where needed
 define CONFIG_SYS_SKIP_RELOC for all archs
 Add generic relocation feature
 arm: Add processor function library
 arm: Move over to generic relocation
 arm: Remove unused code in start.S

 Q1: Should I remove that patch and just repeat the code from there in
 each start.S file?


 You should keep the code that jumps to board_init_r as it is.

I have had a look at this and I don't believe that I can. I need to
call it from C and so it needs to conform to the C calling standard. I
will send a new series showing what I mean.



 The impact would be to remove most of the code in
 the relocate_code() function in each start.S except for the last few
 instructions (reproduced below).


 Yes.


 1. The code that goes on proc.S is already in start.S, which already
 contains things which cannot be written in C and are common functions
 used
 by all ARM CPUs. Granted, right now start.S is duplicated in multiple
 CPU
 directories; so the thing to do is to merge all ARM start.S files into a
 single one, rather than merging only one of its parts.


 Q2: What should this merged file be called and what directory should
 it be in? This is the question I asked last time, and the lack of an
 answer is the reason why I have been unable to make progress here.
 Please advise your preference and I will sort it out.


 Sorry if I missed this question. Obviously the file will be called start.S
 exactly like all its merge ancestors, and it should reside in arch/arm/cpu.

 Note that I already said the merging of start.S should *not* be part of this
 patch set, and should be a patch set of its own.

Yes I don't propose to do this now. I believe that the first 100
instructions may well need to have differences between the CPUs. I
believe we need a common file but that each CPU will need the ability
to override this, using the common file as needed.

Are you saying that you want a start.S in arch/arm/cpu and each
arch/arch/cpu/*/ ? I would prefer there was only one file named
start.S.



 Note I don't think I can do this in one series - there is far too much
 variation between the files for me to take on that way. I need a new
 file than I can bit I bit move things over into, allowing affected
 parties to comment on each as I go.


 Note that I do not require that *you* do such a merge either, though help is
 always welcome of course.


I am happy to take these sorts of things on over time, but really I
want to get the existing efforts in first.


 2. There is no interest in moving this segment of code from all start.S
 files into a new proc.S file: there is no gain is code size obviously,
 and
 there is an increase in source file count.


 Just checking that you see that the code is removed from start.S, not
 moved. The code in proc.S is:

 .globl proc_call_board_init_r
 proc_call_board_init_r:
 #ifndef CONFIG_SYS_ICACHE_OFF
        mcr     p15, 0, r0, c7, c5, 0   @ invalidate icache
        mcr     p15, 0, r0, c7, c10, 4  @ DSB
        mcr     p15, 0, r0, c7, c5, 4   @ ISB
 #endif
        mov     sp, r3
        /* jump to it ... */
        mov     pc, r2

 which is taken from the end of each relocate_code() copy. Assuming we
 are on the page, then ok.


 We are -- the code removed from start.S is relocation, which I quite agree
 with since you replace it with the C relocation code.


 3. I consider that files should contain 'things' based on their common
 /functionality/, not on their similar /nature/, and going about starting
 up
 U-Boot is a functionality.


 The code here sets the stack pointer and calls a function. However I
 agree this unlikely to be useful outside starting up. See Q2.


 Ditto.


 Note that eventually, having a single start.S will achieve the same
 effect
 as this 'proc.S' patch.


 At present start.S runs for a bit and then jumps to board_init_f(). At
 the end of board_init_f() we jump back to start.S (relocate_code()
 function) and from there to board_init_r(). Also start.S has exception
 handling code.

 I think start.S should be thought of as in three parts:
 - early CPU init (hardest to make common)
 - relocation code (last 3 patches of 

[U-Boot] [PATCH v2] MAKEALL: display SPL size if present

2012-02-20 Thread Scott Wood
This makes it easier to detect changes in the SPL portion,
as can currently be done for the main U-Boot image.

Signed-off-by: Scott Wood scottw...@freescale.com
---
v2: Only invoke size once.

 MAKEALL |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 0f2b4a1..c33be1d 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -511,8 +511,12 @@ build_target() {
 
TOTAL_CNT=$((TOTAL_CNT + 1))
 
-   ${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \
-   | tee -a ${LOG_DIR}/$target.MAKELOG
+   OBJS=${BUILD_DIR}/u-boot
+   if [ -e ${BUILD_DIR}/spl/u-boot-spl ]; then
+   OBJS=${OBJS} ${BUILD_DIR}/spl/u-boot-spl
+   fi
+
+   ${CROSS_COMPILE}size ${OBJS} | tee -a ${LOG_DIR}/$target.MAKELOG
 }
 build_targets() {
for t in $@ ; do
-- 
1.7.7.rc3.4.g8d714

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


[U-Boot] [PATCH] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Tom Rini
This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 and
498cbdfe62a8330f6c89765bdd15e60328a26511.  These have introduced some
large problems on all other platforms and have more changes in them than
the commit message implies.

Cc: Heiko Schocher h...@denx.de
Cc: Patil, Rachna rac...@ti.com
Signed-off-by: Tom Rini tr...@ti.com
---
 drivers/i2c/omap24xx_i2c.c |  475 
 drivers/i2c/omap24xx_i2c.h |2 -
 2 files changed, 174 insertions(+), 303 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index f06af02..a7ffd95 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -29,11 +29,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define I2C_STAT_TIMEO (1  31)
-#define I2C_TIMEOUT10
+#define I2C_TIMEOUT1000
 
-static u32 wait_for_bb(void);
-static u32 wait_for_status_mask(u16 mask);
+static void wait_for_bb(void);
+static u16 wait_for_pin(void);
 static void flush_fifo(void);
 
 /*
@@ -51,6 +50,7 @@ void i2c_init(int speed, int slaveadd)
int psc, fsscll, fssclh;
int hsscll = 0, hssclh = 0;
u32 scll, sclh;
+   int timeout = I2C_TIMEOUT;
 
/* Only handle standard, fast and high speeds */
if ((speed != OMAP_I2C_STANDARD) 
@@ -112,14 +112,24 @@ void i2c_init(int speed, int slaveadd)
sclh = (unsigned int)fssclh;
}
 
-   if (gd-flags  GD_FLG_RELOC)
-   bus_initialized[current_bus] = 1;
-
if (readw(i2c_base-con)  I2C_CON_EN) {
writew(0, i2c_base-con);
udelay(5);
}
 
+   writew(0x2, i2c_base-sysc); /* for ES2 after soft reset */
+   udelay(1000);
+
+   writew(I2C_CON_EN, i2c_base-con);
+   while (!(readw(i2c_base-syss)  I2C_SYSS_RDONE)  timeout--) {
+   if (timeout = 0) {
+   puts(ERROR: Timeout in soft-reset\n);
+   return;
+   }
+   udelay(1000);
+   }
+
+   writew(0, i2c_base-con);
writew(psc, i2c_base-psc);
writew(scll, i2c_base-scll);
writew(sclh, i2c_base-sclh);
@@ -135,6 +145,81 @@ void i2c_init(int speed, int slaveadd)
flush_fifo();
writew(0x, i2c_base-stat);
writew(0, i2c_base-cnt);
+
+   if (gd-flags  GD_FLG_RELOC)
+   bus_initialized[current_bus] = 1;
+}
+
+static int i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
+{
+   int i2c_error = 0;
+   u16 status;
+
+   /* wait until bus not busy */
+   wait_for_bb();
+
+   /* one byte only */
+   writew(1, i2c_base-cnt);
+   /* set slave address */
+   writew(devaddr, i2c_base-sa);
+   /* no stop bit needed here */
+   writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT |
+ I2C_CON_TRX, i2c_base-con);
+
+   /* send register offset */
+   while (1) {
+   status = wait_for_pin();
+   if (status == 0 || status  I2C_STAT_NACK) {
+   i2c_error = 1;
+   goto read_exit;
+   }
+   if (status  I2C_STAT_XRDY) {
+   /* Important: have to use byte access */
+   writeb(regoffset, i2c_base-data);
+   writew(I2C_STAT_XRDY, i2c_base-stat);
+   }
+   if (status  I2C_STAT_ARDY) {
+   writew(I2C_STAT_ARDY, i2c_base-stat);
+   break;
+   }
+   }
+
+   /* set slave address */
+   writew(devaddr, i2c_base-sa);
+   /* read one byte from slave */
+   writew(1, i2c_base-cnt);
+   /* need stop bit here */
+   writew(I2C_CON_EN | I2C_CON_MST |
+   I2C_CON_STT | I2C_CON_STP,
+   i2c_base-con);
+
+   /* receive data */
+   while (1) {
+   status = wait_for_pin();
+   if (status == 0 || status  I2C_STAT_NACK) {
+   i2c_error = 1;
+   goto read_exit;
+   }
+   if (status  I2C_STAT_RRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
+   defined(CONFIG_OMAP44XX)
+   *value = readb(i2c_base-data);
+#else
+   *value = readw(i2c_base-data);
+#endif
+   writew(I2C_STAT_RRDY, i2c_base-stat);
+   }
+   if (status  I2C_STAT_ARDY) {
+   writew(I2C_STAT_ARDY, i2c_base-stat);
+   break;
+   }
+   }
+
+read_exit:
+   flush_fifo();
+   writew(0x, i2c_base-stat);
+   writew(0, i2c_base-cnt);
+   return i2c_error;
 }
 
 static void flush_fifo(void)
@@ -147,7 +232,7 @@ static void flush_fifo(void)
stat = readw(i2c_base-stat);
if (stat == I2C_STAT_RRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+   

[U-Boot] [PATCH v4 6/6] SPL: Add README.omap3

2012-02-20 Thread Tom Rini
This document describes the SPL process for OMAP3 (and related) boards
as well as a partial memory map and how to verify certain aspects
outside of running on the target.

Signed-off-by: Tom Rini tr...@ti.com

---
Changes for v4:
- Rework shell line, from Mike Frysinger

Changes for v2:
   - Wording changes from Peter Meerwald
---
 doc/SPL/README.omap3 |   74 ++
 1 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 doc/SPL/README.omap3

diff --git a/doc/SPL/README.omap3 b/doc/SPL/README.omap3
new file mode 100644
index 000..cc5d5c0
--- /dev/null
+++ b/doc/SPL/README.omap3
@@ -0,0 +1,74 @@
+Overview of SPL on OMAP3 devices
+
+
+Introduction
+
+
+This document provides an overview of how SPL functions on OMAP3 (and related
+such as am35x and am37x) processors.
+
+Methodology
+---
+
+On these platforms the ROM supports trying a sequence of boot devices.  Once
+one has been used successfully to load SPL this information is stored in memory
+and the location stored in a register.  We will read this to determine where to
+read U-Boot from in turn.
+
+Memory Map
+--
+
+This is an example of a typical setup.  See top-level README for documentation
+of which CONFIG variables control these values.  For a given board and the
+amount of DRAM available to it different values may need to be used.
+Note that the size of the SPL text rodata and data is enforced with a CONFIG
+option and growing over that size results in a link error.  The SPL stack
+starts at the top of SRAM (which is configurable) and grows downward.  The
+space between the top of SRAM and the enforced upper bound on the size of the
+SPL text, data and rodata is considered the safe stack area.  Details on
+confirming this behavior are shown below.
+
+A portion of the system memory map looks as follows:
+SRAM: 0x4020 - 0x4020
+DDR1: 0x8000 - 0xBFFF
+
+Option 1 (SPL only):
+0x40200800 - 0x4020BBFF: Area for SPL text, data and rodata
+0x4020BC00 - 0x4020FFFC: Area for the SPL stack.
+0x8000 - 0x8007: Area for the SPL BSS.
+0x8010: CONFIG_SYS_TEXT_BASE of U-Boot
+0x80208000 - 0x80307FFF: malloc() pool available to SPL.
+
+Option 2 (SPL or X-Loader):
+0x40200800 - 0x4020BBFF: Area for SPL text, data and rodata
+0x4020BC00 - 0x4020FFFC: Area for the SPL stack.
+0x80008000: CONFIG_SYS_TEXT_BASE of U-Boot
+0x8700 - 0x8707: Area for the SPL BSS.
+0x8708 - 0x870F: malloc() pool available to SPL.
+
+For the areas that reside within DDR1 they must not be used prior to s_init()
+completing.  Note that CONFIG_SYS_TEXT_BASE must be clear of the areas that SPL
+uses while running.  This is why we have two versions of the memory map that
+only vary in where the BSS and malloc pool reside.
+
+Estimating stack usage
+--
+
+With gcc 4.6 (and later) and the use of GNU cflow it is possible to estimate
+stack usage at various points in run sequence of SPL.  The -fstack-usage option
+to gcc will produce '.su' files (such as arch/arm/cpu/armv7/syslib.su) that
+will give stack usage information and cflow can construct program flow.
+
+Must have gcc 4.6 or later, which supports -fstack-usage
+
+1) Build normally
+2) Perform the following shell command to generate a list of C files used in
+SPL:
+$ find spl -name '*.su' | sed -e 's:^spl/::' -e 's:[.]su$:.c:'  used-spl.list
+3) Execute cflow:
+$ cflow --main=board_init_r `cat used-spl.list` 21 | $PAGER
+
+cflow will spit out a number of warnings as it does not parse
+the config files and picks functions based on #ifdef.  Parsing the '.i'
+files instead introduces another set of headaches.  These warnings are
+not usually important to understanding the flow, however.
-- 
1.7.0.4

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


[U-Boot] [PATCH v4 3/6] config.mk: Check for -fstack-usage support

2012-02-20 Thread Tom Rini
Acked-by: Mike Frysinger vap...@gentoo.org
Signed-off-by: Tom Rini tr...@ti.com

---
Changes for v2:
   - Move check from arch/arm/config.mk to config.mk, reword summary

Changes for v3:
   - Drop trailing comma in cc-option call (per Mike Frysinger)

Changes for v4:
   - Add .su files to clean list

add .su to nuke list

Signed-off-by: Tom Rini tr...@ti.com
---
 Makefile  |2 +-
 config.mk |4 
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 11aac21..8e66739 100644
--- a/Makefile
+++ b/Makefile
@@ -749,7 +749,7 @@ clean:
@rm -f $(obj)MLO
@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@find $(OBJTREE) -type f \
-   \( -name 'core' -o -name '*.bak' -o -name '*~' \
+   \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
-o -name '*.o'  -o -name '*.a' -o -name '*.exe' \) -print \
| xargs rm -f
 
diff --git a/config.mk b/config.mk
index 596ba93..fa33e62 100644
--- a/config.mk
+++ b/config.mk
@@ -232,6 +232,10 @@ CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \
   $(call cc-option,-Wno-format-security)
 CFLAGS += $(CFLAGS_WARN)
 
+# Report stack usage if supported
+CFLAGS_STACK := $(call cc-option,-fstack-usage)
+CFLAGS += $(CFLAGS_STACK)
+
 # $(CPPFLAGS) sets -g, which causes gcc to pass a suitable -gformat
 # option to the assembler.
 AFLAGS_DEBUG :=
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Simon Glass
Hi Tom,

On Mon, Feb 20, 2012 at 2:59 PM, Tom Rini tr...@ti.com wrote:
 This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 and
 498cbdfe62a8330f6c89765bdd15e60328a26511.  These have introduced some
 large problems on all other platforms and have more changes in them than
 the commit message implies.

Is it possible to revert each one by one?

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


Re: [U-Boot] [PATCH] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Simon Glass
Hi Tom,

On Mon, Feb 20, 2012 at 4:48 PM, Tom Rini tr...@ti.com wrote:
 On Mon, Feb 20, 2012 at 5:44 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Mon, Feb 20, 2012 at 2:59 PM, Tom Rini tr...@ti.com wrote:
 This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 and
 498cbdfe62a8330f6c89765bdd15e60328a26511.  These have introduced some
 large problems on all other platforms and have more changes in them than
 the commit message implies.

 Is it possible to revert each one by one?

 If that's policy, yes, I can repost as two reverts (enable i2c on
 am335x_evm, big i2c changes).

I don't know about policy, sorry. But it might be easier for people to
see what happened.


 --
 Tom

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


Re: [U-Boot] [PATCH] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Graeme Russ
Hi Simon, Tom

On Tue, Feb 21, 2012 at 12:11 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Mon, Feb 20, 2012 at 4:48 PM, Tom Rini tr...@ti.com wrote:
 On Mon, Feb 20, 2012 at 5:44 PM, Simon Glass s...@chromium.org wrote:
 Hi Tom,

 On Mon, Feb 20, 2012 at 2:59 PM, Tom Rini tr...@ti.com wrote:
 This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 and
 498cbdfe62a8330f6c89765bdd15e60328a26511.  These have introduced some
 large problems on all other platforms and have more changes in them than
 the commit message implies.

 Is it possible to revert each one by one?

 If that's policy, yes, I can repost as two reverts (enable i2c on
 am335x_evm, big i2c changes).

 I don't know about policy, sorry. But it might be easier for people to
 see what happened.

I personally think one revert per patch so the path title is:

Revert: blah

Unless single reverts cause even worse breakage

Regards,

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


Re: [U-Boot] [PATCH V3] ARM: fix s3c2410 timer code

2012-02-20 Thread Minkyu Kang
On 19 February 2012 20:59, Albert ARIBAUD albert.u.b...@aribaud.net wrote:
 Le 22/12/2011 12:16, David Müller a écrit :

 This patch fixes the s3c24x0 timer code to work with the ARM
 relocation feature.

 Signed-off-by: David Muellerd.muel...@elsoft.ch

 ---
  arch/arm/cpu/arm920t/s3c24x0/timer.c |   64
 ++---
  1 files changed, 20 insertions(+), 44 deletions(-)


 Minkyu,

 Shouldn't this go through your tree, or at least get your Ack?


I'm going to apply this patch at u-boot-samsung.
Please wait few days, cuz I have network problem in the office.

David,
Are there other pending patches?
If so, please let me know.

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


[U-Boot] [PATCH v4 0/13] Introduce generic relocation feature

2012-02-20 Thread Simon Glass

(This series has trivial conflicts with the generic board series in the
arch/xxx/config.mk additions and also in that they both add
include/linux/sections.h. I original had this series first in my list,
but the generic board series now also applies directly to master, so I
will leave this one as is until I know what ordering is required.)

This is the second patch series aiming to unify the various board.c files
in each architecture into a single one. This series implements a generic
relocation feature, which is the bridge between board_init_f() and
board_init_r(). It then moves ARM over to use this framework, as an
example.

On ARM the relocation code is duplicated for each CPU yet it
is the same. We can bring this up to the arch level. But since (I believe)
Elf relocation is basically the same process for all archs, there is no
reason not to bring it up to the generic level.

Each architecture which uses this framework needs to provide a function
called arch_elf_relocate_entry() which processes a single relocation
entry. This is a static inline function to reduce code size overhead.

For ARM, a new arch/arm/lib/proc.S file is created, which holds generic
ARM assembler code (things that cannot be written in C and are common
functions used by all ARM CPUs). This helps reduce duplication. Interrupt
handling code and perhaps even some startup code can move there later.

It may be useful for other architectures with a lot of different CPUs
to have a similar file.

Code size on my ARMv7 system increases by 54 bytes with generic
relocation. This overhead is mostly just literal pool access and setting
up to call the relocated U-Boot at the end.

On my system, execution time increases from 10.8ms to 15.6ms due to the
less efficient C implementations of the copy and zero loops. If execution
time is of concern, you can define CONFIG_USE_ARCH_MEMSET and
CONFIG_USE_ARCH_MEMCPY to reduce it. For me this reduces relocation time
to 5.4ms, i.e. twice as fast as the old system.

To address the build failure in tx25 I have split out the memset()/memcpy()
functions into their own file. I believe this is somewhat justified by the
fact that they are now used for relocation, independently of what other
part of U-Boot may or may not use the string functions. The problem with
linking with the whole string.o object file is that the code size is too
large for highly-constrained SPL builds which don't have
-ffunction-sections defined.

Changes in v2:
- Add README file for relocation
- Add function comments
- Import asm-generic/sections.h from Linux and add U-Boot extras
- Make relocation symbols global so we can use them outside start.S
- Move reloc.c into common/
- Squash generic link symbols patch into generic relocation patch
- Use CONFIG_SYS_SKIP_RELOC instead of CONFIG_SYS_LEGACY_BOARD
- Use an inline relocation function to reduce code size
- Use memset, memcpy instead of inline code

Changes in v3:
- Rebase to master
- Remove the 'reloc' tag from each commit

Changes in v4:
- Add new patch to fix davinci build warnings
- Add new patch to fix smdk6400 with generic relocation
- Add new patch to separate out memcpy(), memset()
- Capital D on Define of CONFIG_SYS_SKIP_RELOC commit message
- Put start_call_board_init_r() into each start.S, sadly
- Rebase to master, also bring in ARM master
- Remove proc.S file from Makefiles
- Split out board changes into separate patches
- Split out change to move relocation symbols to top of start.S files
- Split out hawkboard changes into new patch
- Split out mx31pdk changes into new patch
- Split out start_call_board_init_r() addition into new patch
- Split out tx25 changes into new patch
- Update start.S pruning to fit with early patches
- Use renamed start_call_board_init_r() function

Simon Glass (13):
  Define CONFIG_SYS_SKIP_RELOC for all archs
  Add generic relocation feature
  arm: Export and promote relocation symbols
  arm: Add start_call_board_init_r() to each start.S
  Move memcpy(), memset() into new lib/membasic.c
  arm: Add explicit __image_copy_end symbol for ARM926EJ-S
  davinci: Use correct #ifdef around gdata/bdata
  tx25: Modify to work with generic relocation
  hawkboard: Modify to work with generic relocation
  mx31pdk: Modify to work with generic relocation
  smdk6400: Modify to work with generic relocation
  arm: Move over to generic relocation
  arm: Remove unused code in start.S

 README  |4 +
 arch/arm/cpu/arm1136/start.S|  142 +++--
 arch/arm/cpu/arm1176/start.S|  221 +++---
 arch/arm/cpu/arm720t/start.S|  136 +++-
 arch/arm/cpu/arm920t/start.S|  144 +++--
 arch/arm/cpu/arm925t/start.S|  144 +++--
 arch/arm/cpu/arm926ejs/davinci/spl.c|2 +
 arch/arm/cpu/arm926ejs/start.S  |  157 ---
 arch/arm/cpu/arm926ejs/u-boot.lds   |2 +
 

[U-Boot] [PATCH v4 05/13] Move memcpy(), memset() into new lib/membasic.c

2012-02-20 Thread Simon Glass
These basic functions are needed by relocation. To avoid bringing in all
string.c functions (and the resulting code bloat for architectures where
-ffunction-sections is not used), move these into their own file.

Also tidy up the checkpatch warnings and function comments at the same
time.

I considered splitting these into two separate files, but I think that is
overkill. The justification is that these two functions are needed
regardless of what the 'user' code in U-Boot does, just to support
relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add new patch to separate out memcpy(), memset()

 lib/Makefile   |1 +
 lib/membasic.c |  103 
 lib/string.c   |   71 --
 3 files changed, 104 insertions(+), 71 deletions(-)
 create mode 100644 lib/membasic.c

diff --git a/lib/Makefile b/lib/Makefile
index e6e6ec6..0480824 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -57,6 +57,7 @@ endif
 
 COBJS-y += ctype.o
 COBJS-y += div64.o
+COBJS-y += membasic.o
 COBJS-y += string.o
 COBJS-y += time.o
 COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
diff --git a/lib/membasic.c b/lib/membasic.c
new file mode 100644
index 000..2448e4c
--- /dev/null
+++ b/lib/membasic.c
@@ -0,0 +1,103 @@
+/*
+ * Basic memory routines needed by relocation (memcpy, memset).
+ *
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * Copyright (C) 1991, 1992  Linus Torvalds
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include linux/types.h
+#include linux/string.h
+
+
+#ifndef __HAVE_ARCH_MEMSET
+/**
+ * Fill a region of memory with the given value
+ *
+ * @param s Pointer to the start of the area.
+ * @param c The byte to fill the area with
+ * @param count The size of the area.
+ * @return pointer to start of the area (as passed in)
+ *
+ * Do not use memset() to access IO space, use memset_io() instead.
+ */
+void *memset(void *s, int c, size_t count)
+{
+   unsigned long *sl = (unsigned long *) s;
+   unsigned long cl = 0;
+   char *s8;
+   int i;
+
+   /* do it one word at a time (32 bits or 64 bits) while possible */
+   if (((ulong)s  (sizeof(*sl) - 1)) == 0) {
+   for (i = 0; i  sizeof(*sl); i++) {
+   cl = 8;
+   cl |= c  0xff;
+   }
+   while (count = sizeof(*sl)) {
+   *sl++ = cl;
+   count -= sizeof(*sl);
+   }
+   }
+   /* fill 8 bits at a time */
+   s8 = (char *)sl;
+   while (count--)
+   *s8++ = c;
+
+   return s;
+}
+#endif
+
+#ifndef __HAVE_ARCH_MEMCPY
+/**
+ * Copy one area of memory to another
+ *
+ * You should not use this function to access IO space, use memcpy_toio()
+ * or memcpy_fromio() instead.
+ *
+ * @param dest  Where to copy to
+ * @param src   Where to copy from
+ * @param count The size of the area.
+ * @return destination address (as passed in)
+ */
+void *memcpy(void *dest, const void *src, size_t count)
+{
+   unsigned long *dl = (unsigned long *)dest, *sl = (unsigned long *)src;
+   char *d8, *s8;
+
+   if (src == dest)
+   return dest;
+
+   /* while all data is aligned (common case), copy a word at a time */
+   if ulong)dest | (ulong)src)  (sizeof(*dl) - 1)) == 0) {
+   while (count = sizeof(*dl)) {
+   *dl++ = *sl++;
+   count -= sizeof(*dl);
+   }
+   }
+   /* copy the reset one byte at a time */
+   d8 = (char *)dl;
+   s8 = (char *)sl;
+   while (count--)
+   *d8++ = *s8++;
+
+   return dest;
+}
+#endif
diff --git a/lib/string.c b/lib/string.c
index c3ad055..5db0eaf 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -431,42 +431,6 @@ char *strswab(const char *s)
 }
 #endif
 
-#ifndef __HAVE_ARCH_MEMSET
-/**
- * memset - Fill a region of memory with the given value
- * @s: Pointer to the start of the area.
- * @c: The byte to fill the area with
- * @count: The size of the area.
- *
- * Do not use memset() to access IO space, use memset_io() instead.
- */
-void * memset(void * s,int c,size_t count)
-{
-   

[U-Boot] [PATCH v4 04/13] arm: Add start_call_board_init_r() to each start.S

2012-02-20 Thread Simon Glass
We don't want this in a common file, or at least not yet, so add
this function to every start.S individually. The existing code tacked
on the end of a long relocation function and does not suit our needs
since it doesn't allow the address of board_init_r() to be passed in
and cannot be called from C since it expects values in registers r4
and above.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Put start_call_board_init_r() into each start.S, sadly
- Split out start_call_board_init_r() addition into new patch

 arch/arm/cpu/arm1136/start.S   |   19 +++
 arch/arm/cpu/arm1176/start.S   |   19 +++
 arch/arm/cpu/arm720t/start.S   |   19 +++
 arch/arm/cpu/arm920t/start.S   |   19 +++
 arch/arm/cpu/arm925t/start.S   |   19 +++
 arch/arm/cpu/arm926ejs/start.S |   19 +++
 arch/arm/cpu/arm946es/start.S  |   19 +++
 arch/arm/cpu/arm_intcm/start.S |   19 +++
 arch/arm/cpu/armv7/start.S |   19 +++
 arch/arm/cpu/ixp/start.S   |   19 +++
 arch/arm/cpu/lh7a40x/start.S   |   19 +++
 arch/arm/cpu/pxa/start.S   |   20 
 arch/arm/cpu/s3c44b0/start.S   |   19 +++
 arch/arm/cpu/sa1100/start.S|   19 +++
 14 files changed, 267 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 28e059e..e74d5f9 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -295,6 +295,25 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
+/**
+ * Jump to board_init_r with a new stack pointer
+ *
+ * @param gd   Pointer to global data
+ * @param dest_addrDestination address from global data
+ * @param func Address of board_init_r function (relocated)
+ * @param sp   New stack pointer
+ */
+.globl start_call_board_init_r
+start_call_board_init_r:
+#ifndef CONFIG_SYS_ICACHE_OFF
+   mcr p15, 0, r0, c7, c5, 0   @ invalidate icache
+   mcr p15, 0, r0, c7, c10, 4  @ DSB
+   mcr p15, 0, r0, c7, c5, 4   @ ISB
+#endif
+   mov sp, r3
+   /* jump to it ... */
+   mov pc, r2
+
 /*
  *
  *
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 0c749b4..7fc6a18 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -397,6 +397,25 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
+/**
+ * Jump to board_init_r with a new stack pointer
+ *
+ * @param gd   Pointer to global data
+ * @param dest_addrDestination address from global data
+ * @param func Address of board_init_r function (relocated)
+ * @param sp   New stack pointer
+ */
+.globl start_call_board_init_r
+start_call_board_init_r:
+#ifndef CONFIG_SYS_ICACHE_OFF
+   mcr p15, 0, r0, c7, c5, 0   @ invalidate icache
+   mcr p15, 0, r0, c7, c10, 4  @ DSB
+   mcr p15, 0, r0, c7, c5, 4   @ ISB
+#endif
+   mov sp, r3
+   /* jump to it ... */
+   mov pc, r2
+
 #ifdef CONFIG_ENABLE_MMU
 _mmu_table_base:
.word mmu_table
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 80814d6..cdbe751 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -266,6 +266,25 @@ clbss_l:strr2, [r0]/* clear 
loop...*/
 _board_init_r_ofs:
.word board_init_r - _start
 
+/**
+ * Jump to board_init_r with a new stack pointer
+ *
+ * @param gd   Pointer to global data
+ * @param dest_addrDestination address from global data
+ * @param func Address of board_init_r function (relocated)
+ * @param sp   New stack pointer
+ */
+.globl start_call_board_init_r
+start_call_board_init_r:
+#ifndef CONFIG_SYS_ICACHE_OFF
+   mcr p15, 0, r0, c7, c5, 0   @ invalidate icache
+   mcr p15, 0, r0, c7, c10, 4  @ DSB
+   mcr p15, 0, r0, c7, c5, 4   @ ISB
+#endif
+   mov sp, r3
+   /* jump to it ... */
+   mov pc, r2
+
 /*
  *
  *
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 57b2b59..3257df6 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -317,6 +317,25 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
+/**
+ * Jump to board_init_r with a new stack pointer
+ *
+ * @param gd   Pointer to global data
+ * @param dest_addrDestination address from global data
+ * @param func Address of board_init_r function (relocated)
+ * @param sp   New stack pointer
+ */
+.globl start_call_board_init_r
+start_call_board_init_r:
+#ifndef CONFIG_SYS_ICACHE_OFF
+   mcr p15, 0, r0, c7, c5, 0   @ invalidate icache
+   mcr p15, 0, r0, c7, c10, 4  @ DSB
+   mcr p15, 0, 

[U-Boot] [PATCH v4 08/13] tx25: Modify to work with generic relocation

2012-02-20 Thread Simon Glass
Add use of common/ and lib/ libraries for the SPL stage, and
add the new link symbol required for generic relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Split out tx25 changes into new patch

 include/configs/tx25.h  |2 ++
 nand_spl/board/karo/tx25/Makefile   |   11 ++-
 nand_spl/board/karo/tx25/u-boot.lds |1 +
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/configs/tx25.h b/include/configs/tx25.h
index 87bd8a6..115d810 100644
--- a/include/configs/tx25.h
+++ b/include/configs/tx25.h
@@ -58,6 +58,8 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+
 #define CONFIG_DISPLAY_CPUINFO
 
 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
diff --git a/nand_spl/board/karo/tx25/Makefile 
b/nand_spl/board/karo/tx25/Makefile
index 0336346..c253d42 100644
--- a/nand_spl/board/karo/tx25/Makefile
+++ b/nand_spl/board/karo/tx25/Makefile
@@ -33,7 +33,10 @@ AFLAGS   += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 CFLAGS += -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS  = start.o lowlevel_init.o
-COBJS  = nand_boot_fsl_nfc.o
+COBJS  = nand_boot_fsl_nfc.o membasic.o
+ifndef CONFIG_SYS_SKIP_RELOC
+COBJS  += reloc.o
+endif
 
 SRCS   := $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
 SRCS   += $(SRCTREE)/arch/arm/cpu/arm926ejs/start.S
@@ -71,6 +74,12 @@ $(obj)%.o:   $(SRCTREE)/board/karo/tx25/%.S
 $(obj)%.o: $(SRCTREE)/nand_spl/%.c
$(CC) $(CFLAGS) -c -o $@ $
 
+$(obj)%.o: $(SRCTREE)/common/%.c
+   $(CC) $(CFLAGS) -c -o $@ $
+
+$(obj)%.o: $(SRCTREE)/lib/%.c
+   $(CC) $(CFLAGS) -c -o $@ $
+
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
diff --git a/nand_spl/board/karo/tx25/u-boot.lds 
b/nand_spl/board/karo/tx25/u-boot.lds
index d2b08f6..2273e9b 100644
--- a/nand_spl/board/karo/tx25/u-boot.lds
+++ b/nand_spl/board/karo/tx25/u-boot.lds
@@ -51,6 +51,7 @@ SECTIONS
__u_boot_cmd_end = .;
 
. = ALIGN(4);
+   __image_copy_end = .;
 
.rel.dyn : {
__rel_dyn_start = .;
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 02/13] Add generic relocation feature

2012-02-20 Thread Simon Glass
Add a relocation implementation as the first thing in the generic board
library. This library is needed by SPL also.

We create a separate header file for link symbols defined by the link
scripts. It is helpful to have these all in one place and try to
make them common across architectures. Since Linux already has a similar
file, we bring this in even though many of the symbols there are not
relevant to us.

The __relocate_code() function is what we expect all architectures which
support relocation will use eventually. For now, they all override this
with their own version.

Note: The conflict with the generic board series is that the file
include/asm-generic/sections.h is created in both. This should be easy
to resolve once we know the order in which these series will be applied.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add README file for relocation
- Add function comments
- Import asm-generic/sections.h from Linux and add U-Boot extras
- Move reloc.c into common/
- Squash generic link symbols patch into generic relocation patch
- Use memset, memcpy instead of inline code

Changes in v4:
- Use renamed start_call_board_init_r() function

 common/Makefile|4 +
 common/reloc.c |  121 
 doc/README.relocation  |   87 
 include/asm-generic/sections.h |   92 ++
 include/reloc.h|   17 +-
 5 files changed, 320 insertions(+), 1 deletions(-)
 create mode 100644 common/reloc.c
 create mode 100644 doc/README.relocation
 create mode 100644 include/asm-generic/sections.h

diff --git a/common/Makefile b/common/Makefile
index 2d9ae8c..3801c28 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -189,6 +189,10 @@ COBJS-y += dlmalloc.o
 COBJS-y += memsize.o
 COBJS-y += stdio.o
 
+ifndef CONFIG_SYS_SKIP_RELOC
+COBJS-y += reloc.o
+endif
+
 
 COBJS  := $(sort $(COBJS-y))
 XCOBJS := $(sort $(XCOBJS-y))
diff --git a/common/reloc.c b/common/reloc.c
new file mode 100644
index 000..85fdb6d
--- /dev/null
+++ b/common/reloc.c
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm-generic/sections.h
+#include asm/reloc.h
+#include reloc.h
+#include nand.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static int reloc_make_copy(void)
+{
+   char *dst_addr = (char *)gd-relocaddr;
+
+   /* TODO: __text_start would be better when we have it */
+   char *src_addr = (char *)_start;
+   /* TODO: switch over to __image_copy_end when we can */
+#ifdef CONFIG_SPL_BUILD
+   char *end_addr = src_addr + _image_copy_end_ofs;
+#else
+   char *end_addr = src_addr + _rel_dyn_start_ofs;
+#endif
+
+   if (dst_addr != src_addr) {
+   size_t size = end_addr - src_addr;
+
+   debug(%s: copy code %p-%p to %p-%p\n, __func__,
+ src_addr, end_addr, dst_addr, dst_addr + size);
+   memcpy(dst_addr, src_addr, size);
+   }
+   return 0;
+}
+
+static int reloc_elf(void)
+{
+#ifndef CONFIG_SPL_BUILD
+   const Elf32_Rel *ptr, *end;
+   Elf32_Addr *addr;
+   char *src_addr = (char *)_start;
+   Elf32_Sym *dynsym;
+   ulong reloc_ofs = gd-reloc_off;
+
+   /* scan the relocation table for relevant entries */
+   ptr = (Elf32_Rel *)(src_addr + _rel_dyn_start_ofs);
+   end = (Elf32_Rel *)(src_addr + _rel_dyn_end_ofs);
+   dynsym = (Elf32_Sym *)(src_addr + _dynsym_start_ofs);
+   debug(%s: process reloc entries %p-%p, dynsym at %p\n, __func__,
+ ptr, end, dynsym);
+   for (; ptr  end; ptr++) {
+   addr = (Elf32_Addr *)(ptr-r_offset + reloc_ofs);
+   if (arch_elf_relocate_entry(addr, ptr-r_info, dynsym,
+   reloc_ofs))
+   return -1;
+   }
+#endif
+   return 0;
+}
+
+static int reloc_clear_bss(void)
+{
+   char *dst_addr = (char *)_start + _bss_start_ofs;
+   size_t size = _bss_end_ofs - _bss_start_ofs;
+
+#ifndef CONFIG_SPL_BUILD
+   /* No relocation for SPL (TBD: better to set reloc_off to zero) */
+   

[U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-20 Thread Simon Glass
This fixes the following warnings in an SPL build when libcommon is
in use:

spl.c:37: warning: 'gdata' defined but not used
spl.c:38: warning: 'bdata' defined but not used

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add new patch to fix davinci build warnings

 arch/arm/cpu/arm926ejs/davinci/spl.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
index b1eff26..2861907 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -32,10 +32,12 @@
 
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 
+#ifdef CONFIG_SPL_SPI_LOAD
 DECLARE_GLOBAL_DATA_PTR;
 /* Define global data structure pointer to it*/
 static gd_t gdata __attribute__ ((section(.data)));
 static bd_t bdata __attribute__ ((section(.data)));
+#endif
 
 #else
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 01/13] Define CONFIG_SYS_SKIP_RELOC for all archs

2012-02-20 Thread Simon Glass
We are introducing a new generic relocation features and we want this to
be the default. So we need to opt all architectures out first. Some may
never have relocation, but those that do will eventually move over to
this generic relocation framework.

This is part of the unified board effort, but since we are only dealing
with relocation in this series, CONFIG_SYS_SKIP_RELOC is more appropriate
than CONFIG_SYS_LEGACY_BOARD.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Use CONFIG_SYS_SKIP_RELOC instead of CONFIG_SYS_LEGACY_BOARD

Changes in v4:
- Capital D on Define of CONFIG_SYS_SKIP_RELOC commit message

 README|4 
 arch/arm/config.mk|3 +++
 arch/avr32/config.mk  |3 +++
 arch/blackfin/config.mk   |3 +++
 arch/m68k/config.mk   |3 +++
 arch/microblaze/config.mk |3 +++
 arch/mips/config.mk   |3 +++
 arch/nds32/config.mk  |3 +++
 arch/nios2/config.mk  |3 +++
 arch/powerpc/config.mk|3 +++
 arch/sandbox/config.mk|3 +++
 arch/sh/config.mk |3 +++
 arch/sparc/config.mk  |3 +++
 arch/x86/config.mk|3 +++
 14 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/README b/README
index 8964672..cbec491 100644
--- a/README
+++ b/README
@@ -2770,6 +2770,10 @@ Configuration Settings:
cases. This setting can be used to tune behaviour; see
lib/hashtable.c for details.
 
+- CONFIG_SYS_SKIP_RELOC
+   This makes U-Boot skip relocation for those architectures which
+   don't support it. It is normally defined in arch/xxx/config.mk
+
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
 following configurations:
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..f47d4f7 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -81,3 +81,6 @@ endif
 ifndef CONFIG_NAND_SPL
 LDFLAGS_u-boot += -pie
 endif
+
+# We use legacy relocation for now
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk
index d8e7ebb..1995983 100644
--- a/arch/avr32/config.mk
+++ b/arch/avr32/config.mk
@@ -31,3 +31,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS_u-boot = --gc-sections --relax
 
 LDSCRIPT   = $(SRCTREE)/$(CPUDIR)/u-boot.lds
+
+# We use legacy relocation for now
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 3595aa2..56047c8 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -37,6 +37,9 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst 
,,$(CONFIG_BFIN_BOOT_MODE)))
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
+# Blackfin does not do relocation
+CONFIG_SYS_SKIP_RELOC := y
+
 LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk
index 11ba334..52bfc81 100644
--- a/arch/m68k/config.mk
+++ b/arch/m68k/config.mk
@@ -29,3 +29,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
 PLATFORM_RELFLAGS  += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL  += --gc-sections
+
+# We use legacy relocation for now
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index abea70b..7645f2e 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -29,3 +29,6 @@ CROSS_COMPILE ?= mb-
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
+
+# Microblaze does not do relocation
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 6ab8acd..832b93f 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -52,3 +52,6 @@ PLATFORM_CPPFLAGS += -msoft-float
 PLATFORM_LDFLAGS   += -G 0 -static -n -nostdlib
 PLATFORM_RELFLAGS  += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL  += --gc-sections
+
+# We use legacy relocation for now
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk
index c589829..4a4499b 100644
--- a/arch/nds32/config.mk
+++ b/arch/nds32/config.mk
@@ -33,3 +33,6 @@ PLATFORM_RELFLAGS += -gdwarf-2
 PLATFORM_CPPFLAGS  += -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
 
 LDFLAGS_u-boot = --gc-sections --relax
+
+# We use legacy relocation for now
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
index 7b03ed8..cde7f82 100644
--- a/arch/nios2/config.mk
+++ b/arch/nios2/config.mk
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -G0
 
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
+
+# NIOS2 does not do relocation
+CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/powerpc/config.mk 

[U-Boot] [PATCH v4 06/13] arm: Add explicit __image_copy_end symbol for ARM926EJ-S

2012-02-20 Thread Simon Glass
The start of the BSS is normally the end of the region in the image
that must be copied for relocation to work. But for SPL this is apparently
not always true, and ARMv7 has an explicit __image_copy_end symbol for
this. Add this new symbol to ARM926EJ-S to support SPL under generic
relocation.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/arm926ejs/start.S|4 
 arch/arm/cpu/arm926ejs/u-boot.lds |2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 2c8ff81..ecb44f1 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -146,6 +146,10 @@ _TEXT_BASE:
 _bss_start_ofs:
.word __bss_start - _start
 
+.global _image_copy_end_ofs
+_image_copy_end_ofs:
+.word   __image_copy_end - _start
+
 .globl _bss_end_ofs
 _bss_end_ofs:
.word __bss_end__ - _start
diff --git a/arch/arm/cpu/arm926ejs/u-boot.lds 
b/arch/arm/cpu/arm926ejs/u-boot.lds
index 1480e0c..069cd1b 100644
--- a/arch/arm/cpu/arm926ejs/u-boot.lds
+++ b/arch/arm/cpu/arm926ejs/u-boot.lds
@@ -52,6 +52,8 @@ SECTIONS
 
. = ALIGN(4);
 
+__image_copy_end = .;
+
.rel.dyn : {
__rel_dyn_start = .;
*(.rel*)
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 09/13] hawkboard: Modify to work with generic relocation

2012-02-20 Thread Simon Glass
Add use of common/ and lib/ libraries for the SPL stage, and
add the new link symbol required for generic relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Split out hawkboard changes into new patch

 board/davinci/da8xxevm/u-boot-spl-hawk.lds |1 +
 include/configs/hawkboard.h|2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds 
b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
index b3a41af..4bbfa3d 100644
--- a/board/davinci/da8xxevm/u-boot-spl-hawk.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -58,6 +58,7 @@ SECTIONS
}
 
. = ALIGN(4);
+__image_copy_end = .;
__rel_dyn_start = .;
__rel_dyn_end = .;
__dynsym_start = .;
diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
index 50a1c17..85a955b 100644
--- a/include/configs/hawkboard.h
+++ b/include/configs/hawkboard.h
@@ -63,6 +63,8 @@
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_LOAD
 #define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_LDSCRIPTboard/$(BOARDDIR)/u-boot-spl-hawk.lds
 #define CONFIG_SPL_TEXT_BASE   0xc108
 #define CONFIG_SPL_STACK   CONFIG_SYS_INIT_SP_ADDR
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 03/13] arm: Export and promote relocation symbols

2012-02-20 Thread Simon Glass
These symbols are currently part-way through each file. Most have the same
code, but there are small variations.

We move all these relocation symbols to the start next to the other
exported symbols, and export them so we can use them in generic relocation
code.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Split out change to move relocation symbols to top of start.S files

 arch/arm/cpu/arm1136/start.S   |   19 ---
 arch/arm/cpu/arm1176/start.S   |   19 ---
 arch/arm/cpu/arm720t/start.S   |   19 ---
 arch/arm/cpu/arm920t/start.S   |   19 ---
 arch/arm/cpu/arm925t/start.S   |   19 ---
 arch/arm/cpu/arm926ejs/start.S |   19 ---
 arch/arm/cpu/arm946es/start.S  |   19 ---
 arch/arm/cpu/arm_intcm/start.S |   19 ---
 arch/arm/cpu/armv7/start.S |   20 ++--
 arch/arm/cpu/ixp/start.S   |   19 ---
 arch/arm/cpu/lh7a40x/start.S   |   19 ---
 arch/arm/cpu/pxa/start.S   |   18 --
 arch/arm/cpu/s3c44b0/start.S   |   19 ---
 arch/arm/cpu/sa1100/start.S|   19 ---
 14 files changed, 170 insertions(+), 96 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index c0db96c..28e059e 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -108,6 +108,18 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
+.globl _rel_dyn_start_ofs
+_rel_dyn_start_ofs:
+   .word __rel_dyn_start - _start
+
+.globl _rel_dyn_end_ofs
+_rel_dyn_end_ofs:
+   .word __rel_dyn_end - _start
+
+.globl _dynsym_start_ofs
+_dynsym_start_ofs:
+   .word __dynsym_start - _start
+
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -283,13 +295,6 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
-_rel_dyn_start_ofs:
-   .word __rel_dyn_start - _start
-_rel_dyn_end_ofs:
-   .word __rel_dyn_end - _start
-_dynsym_start_ofs:
-   .word __dynsym_start - _start
-
 /*
  *
  *
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index 848144a..0c749b4 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -127,6 +127,18 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
+.globl _rel_dyn_start_ofs
+_rel_dyn_start_ofs:
+   .word __rel_dyn_start - _start
+
+.globl _rel_dyn_end_ofs
+_rel_dyn_end_ofs:
+   .word __rel_dyn_end - _start
+
+.globl _dynsym_start_ofs
+_dynsym_start_ofs:
+   .word __dynsym_start - _start
+
 /* IRQ stack memory (calculated at run-time) + 8 bytes */
 .globl IRQ_STACK_START_IN
 IRQ_STACK_START_IN:
@@ -385,13 +397,6 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
-_rel_dyn_start_ofs:
-   .word __rel_dyn_start - _start
-_rel_dyn_end_ofs:
-   .word __rel_dyn_end - _start
-_dynsym_start_ofs:
-   .word __dynsym_start - _start
-
 #ifdef CONFIG_ENABLE_MMU
 _mmu_table_base:
.word mmu_table
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 540e3c2..80814d6 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -97,6 +97,18 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
+.globl _rel_dyn_start_ofs
+_rel_dyn_start_ofs:
+   .word __rel_dyn_start - _start
+
+.globl _rel_dyn_end_ofs
+_rel_dyn_end_ofs:
+   .word __rel_dyn_end - _start
+
+.globl _dynsym_start_ofs
+_dynsym_start_ofs:
+   .word __dynsym_start - _start
+
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -254,13 +266,6 @@ clbss_l:strr2, [r0]/* clear 
loop...*/
 _board_init_r_ofs:
.word board_init_r - _start
 
-_rel_dyn_start_ofs:
-   .word __rel_dyn_start - _start
-_rel_dyn_end_ofs:
-   .word __rel_dyn_end - _start
-_dynsym_start_ofs:
-   .word __dynsym_start - _start
-
 /*
  *
  *
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 8c5612c..57b2b59 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -93,6 +93,18 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
+.globl _rel_dyn_start_ofs
+_rel_dyn_start_ofs:
+   .word __rel_dyn_start - _start
+
+.globl _rel_dyn_end_ofs
+_rel_dyn_end_ofs:
+   .word __rel_dyn_end - _start
+
+.globl _dynsym_start_ofs
+_dynsym_start_ofs:
+   .word __dynsym_start - _start
+
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -305,13 +317,6 @@ _board_init_r_ofs:
.word board_init_r - _start
 #endif
 
-_rel_dyn_start_ofs:
-   .word __rel_dyn_start - _start
-_rel_dyn_end_ofs:
-   .word __rel_dyn_end - _start

[U-Boot] [PATCH v4 13/13] arm: Remove unused code in start.S

2012-02-20 Thread Simon Glass
Now that we are using the generic relocation framework, we don't need this
code.

Note: Here we lose the ARM1176's enable_mmu code. This seems to duplicate
code already in U-Boot now. Can anyone comment on this?

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Make relocation symbols global so we can use them outside start.S

Changes in v3:
- Rebase to master
- Remove the 'reloc' tag from each commit

Changes in v4:
- Rebase to master, also bring in ARM master
- Update start.S pruning to fit with early patches

 arch/arm/cpu/arm1136/start.S   |  114 ---
 arch/arm/cpu/arm1176/start.S   |  193 
 arch/arm/cpu/arm720t/start.S   |  108 --
 arch/arm/cpu/arm920t/start.S   |  116 
 arch/arm/cpu/arm925t/start.S   |  116 
 arch/arm/cpu/arm926ejs/start.S |  125 --
 arch/arm/cpu/arm946es/start.S  |  111 ---
 arch/arm/cpu/arm_intcm/start.S |  116 
 arch/arm/cpu/armv7/start.S |  121 -
 arch/arm/cpu/ixp/start.S   |  108 --
 arch/arm/cpu/lh7a40x/start.S   |  105 --
 arch/arm/cpu/pxa/start.S   |  121 -
 arch/arm/cpu/s3c44b0/start.S   |  108 --
 arch/arm/cpu/sa1100/start.S|  105 --
 14 files changed, 0 insertions(+), 1667 deletions(-)

diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index e74d5f9..06c91dd 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -181,120 +181,6 @@ call_board_init_f:
 
bl  board_init_f
 
-/*--*/
-
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This function does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- */
-   .globl  relocate_code
-relocate_code:
-   mov r4, r0  /* save addr_sp */
-   mov r5, r1  /* save addr of gd */
-   mov r6, r2  /* save addr of destination */
-
-   /* Set up the stack */
-stack_setup:
-   mov sp, r4
-
-   adr r0, _start
-   cmp r0, r6
-   beq clear_bss   /* skip relocation */
-   mov r1, r6  /* r1 - scratch for copy_loop */
-   ldr r3, _bss_start_ofs
-   add r2, r0, r3  /* r2 - source end address */
-
-copy_loop:
-   ldmia   r0!, {r9-r10}   /* copy from source address [r0]*/
-   stmia   r1!, {r9-r10}   /* copy to   target address [r1]*/
-   cmp r0, r2  /* until source end address [r2]*/
-   blo copy_loop
-
-#ifndef CONFIG_SPL_BUILD
-   /*
-* fix .rel.dyn relocations
-*/
-   ldr r0, _TEXT_BASE  /* r0 - Text base */
-   sub r9, r6, r0  /* r9 - relocation offset */
-   ldr r10, _dynsym_start_ofs  /* r10 - sym table ofs */
-   add r10, r10, r0/* r10 - sym table in FLASH */
-   ldr r2, _rel_dyn_start_ofs  /* r2 - rel dyn start ofs */
-   add r2, r2, r0  /* r2 - rel dyn start in FLASH */
-   ldr r3, _rel_dyn_end_ofs/* r3 - rel dyn end ofs */
-   add r3, r3, r0  /* r3 - rel dyn end in FLASH */
-fixloop:
-   ldr r0, [r2]/* r0 - location to fix up, IN FLASH! 
*/
-   add r0, r0, r9  /* r0 - location to fix up in RAM */
-   ldr r1, [r2, #4]
-   and r7, r1, #0xff
-   cmp r7, #23 /* relative fixup? */
-   beq fixrel
-   cmp r7, #2  /* absolute fixup? */
-   beq fixabs
-   /* ignore unknown type of fixup */
-   b   fixnext
-fixabs:
-   /* absolute fix: set location to (offset) symbol value */
-   mov r1, r1, LSR #4  /* r1 - symbol index in .dynsym */
-   add r1, r10, r1 /* r1 - address of symbol in table */
-   ldr r1, [r1, #4]/* r1 - symbol value */
-   add r1, r1, r9  /* r1 - relocated sym addr */
-   b   fixnext
-fixrel:
-   /* relative fix: increase location by offset */
-   ldr r1, [r0]
-   add r1, r1, r9
-fixnext:
-   str r1, [r0]
-   add r2, r2, #8  /* each rel.dyn entry is 8 bytes */
-   cmp r2, r3
-   blo fixloop
-#endif
-
-clear_bss:
-#ifndef CONFIG_SPL_BUILD
-   ldr r0, _bss_start_ofs
-   ldr r1, _bss_end_ofs
-   mov r4, r6  /* reloc addr */
-   add r0, r0, r4
-   add r1, r1, r4
-   mov r2, #0x /* clear*/
-
-clbss_l:strr2, [r0]/* clear 

[U-Boot] [PATCH v4 12/13] arm: Move over to generic relocation

2012-02-20 Thread Simon Glass
Add a function to process a single ELF relocation and switch ARM over
to use generic relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Use an inline relocation function to reduce code size

Changes in v4:
- Remove proc.S file from Makefiles
- Split out board changes into separate patches

 arch/arm/config.mk   |3 --
 arch/arm/include/asm/reloc.h |   56 ++
 2 files changed, 56 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/reloc.h

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index f47d4f7..45f9dca 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -81,6 +81,3 @@ endif
 ifndef CONFIG_NAND_SPL
 LDFLAGS_u-boot += -pie
 endif
-
-# We use legacy relocation for now
-CONFIG_SYS_SKIP_RELOC := y
diff --git a/arch/arm/include/asm/reloc.h b/arch/arm/include/asm/reloc.h
new file mode 100644
index 000..3b6491d
--- /dev/null
+++ b/arch/arm/include/asm/reloc.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include elf.h
+
+/**
+ * Process a single ELF relocation entry
+ *
+ * @param addr Pointer to address of intruction/data to relocate
+ * @param info The ELF information word / flags
+ * @param symtab   The ELF relocation symbol table
+ * @param reloc_offOffset of relocated U-Boot relative to load address
+ * @return 0 if ok, -1 on error
+ */
+static inline int arch_elf_relocate_entry(Elf32_Addr *addr, Elf32_Word info,
+   Elf32_Sym *symtab, ulong reloc_off)
+{
+   int sym;
+
+   switch (ELF32_R_TYPE(info)) {
+   /* relative fix: increase location by offset */
+   case 23: /* TODO: add R_ARM_... defines to elf.h */
+   *addr += reloc_off;
+   break;
+
+   /* absolute fix: set location to (offset) symbol value */
+   case 2:
+   sym = ELF32_R_SYM(info);
+   *addr = symtab[sym].st_value + reloc_off;
+   break;
+
+   default:
+   debug(*** Invalid relocation\n);
+   return -1;
+   }
+   return 0;
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 10/13] mx31pdk: Modify to work with generic relocation

2012-02-20 Thread Simon Glass
This adds a link symbol and updates the board Makefile so that it's
SPL implementation will work with generic relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Split out mx31pdk changes into new patch

 nand_spl/board/freescale/mx31pdk/Makefile   |6 ++
 nand_spl/board/freescale/mx31pdk/u-boot.lds |1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/nand_spl/board/freescale/mx31pdk/Makefile 
b/nand_spl/board/freescale/mx31pdk/Makefile
index 87784d2..4598206 100644
--- a/nand_spl/board/freescale/mx31pdk/Makefile
+++ b/nand_spl/board/freescale/mx31pdk/Makefile
@@ -13,6 +13,9 @@ CFLAGS+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS  = start.o lowlevel_init.o
 COBJS  = nand_boot_fsl_nfc.o
+ifndef CONFIG_SYS_SKIP_RELOC
+COBJS  += reloc.o
+endif
 
 SRCS   := $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
 SRCS   += $(SRCTREE)/arch/arm/cpu/arm1136/start.S
@@ -50,6 +53,9 @@ $(obj)%.o:$(SRCTREE)/board/freescale/mx31pdk/%.S
 $(obj)%.o: $(SRCTREE)/nand_spl/%.c
$(CC) $(CFLAGS) -c -o $@ $
 
+$(obj)%.o: $(SRCTREE)/common/%.c
+   $(CC) $(CFLAGS) -c -o $@ $
+
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds 
b/nand_spl/board/freescale/mx31pdk/u-boot.lds
index d2b08f6..2273e9b 100644
--- a/nand_spl/board/freescale/mx31pdk/u-boot.lds
+++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds
@@ -51,6 +51,7 @@ SECTIONS
__u_boot_cmd_end = .;
 
. = ALIGN(4);
+   __image_copy_end = .;
 
.rel.dyn : {
__rel_dyn_start = .;
-- 
1.7.7.3

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


[U-Boot] [PATCH v4 11/13] smdk6400: Modify to work with generic relocation

2012-02-20 Thread Simon Glass
This seems to use an old SPL framework, or at least it is ugly enough
that I hope it is old. Add symlinks for the new files required by
generic relocation.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add new patch to fix smdk6400 with generic relocation

 nand_spl/board/samsung/smdk6400/Makefile |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/nand_spl/board/samsung/smdk6400/Makefile 
b/nand_spl/board/samsung/smdk6400/Makefile
index c9e75ba..c79e12b 100644
--- a/nand_spl/board/samsung/smdk6400/Makefile
+++ b/nand_spl/board/samsung/smdk6400/Makefile
@@ -39,6 +39,9 @@ CFLAGS+= -DCONFIG_NAND_SPL -ffunction-sections
 
 SOBJS  = start.o cpu_init.o lowlevel_init.o
 COBJS  = nand_boot.o nand_ecc.o s3c64xx.o smdk6400_nand_spl.o nand_base.o
+ifndef CONFIG_SYS_SKIP_RELOC
+COBJS  += reloc.o membasic.o
+endif
 
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
@@ -101,6 +104,14 @@ $(obj)smdk6400_nand_spl.c:
 $(obj)nand_base.c:
@rm -f $@
@ln -s $(TOPDIR)/drivers/mtd/nand/nand_base.c $@
+
+$(obj)reloc.c:
+   @rm -f $@
+   @ln -s $(TOPDIR)/common/reloc.c $@
+
+$(obj)membasic.c:
+   @rm -f $@
+   @ln -s $(TOPDIR)/lib/membasic.c $@
 #
 
 $(obj)%.o: $(obj)%.S
-- 
1.7.7.3

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


Re: [U-Boot] [PATCH v2 0/7] Tidy up ARM link scripts

2012-02-20 Thread Simon Glass
Hi Albert,

On Fri, Feb 17, 2012 at 2:47 AM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Marek,

 Le 17/02/2012 10:49, Marek Vasut a écrit :

 Hi Simon,

 Le 21/11/2011 21:49, Simon Glass a écrit :

 The ARM link scripts are very similar but each CPU has its own. This
 series adds support for a default link script across an architecture
 in arch/arch/cpu/u-boot.lds.


 This patch series received no comments, and I apologize for not having
 chimed in on it as it goes the right way about simplifying ARM
 architecture.

 Currently, all patches in the series do apply except patch 7, which
 fails on arch/arm/cpu/pxa/u-boot.lds. As this is trivial, I'm going on
 removing the file manually and testing, but can you please resubmit V3
 with a fixed 1/7 patch?


 Please make sure there were no changes to the linker file. I believe there
 were
 some and it might break pxa.

 Thanks!


 Thanks for pointing this out. I am not testing pxa boards now, so Simon has
 time to submit a vV3 patch set before I get bitten by any change in PXA
 boards.

Yes there was a change to add a 4KB MMU memory area to the link
script, presumably to allow early MMU enable and using that cache
space as SRAM.

I think I will add this feature to the generic .lds file since it does
no harm, and it's a feature I would like to implement one day (early
MMU enable). It might help ARM11 also.


 Amicalement,
 --
 Albert.

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


Re: [U-Boot] [PATCH v2 6/7] arm: add a common .lds link script

2012-02-20 Thread Simon Glass
Hi Albert,

On Fri, Feb 17, 2012 at 3:08 AM, Albert ARIBAUD
albert.u.b...@aribaud.net wrote:
 Hi Simon,

 Le 21/11/2011 21:49, Simon Glass a écrit :


 +       .text :
 +       {
 +               __text_start = .;


 This assignment to __text_start does not exist in any of the existing
 u-boot.lds files. What is the point of it?

I would like to have a single symbol for the start of the text region
across all architectures. ARM has _start but this is not present
elsewhere. Also I think it should be defined by the link script.



 +       .u_boot_cmd : { *(.u_boot_cmd) }
 +       __u_boot_cmd_end = .;
 +
 +       . = ALIGN(4);
 +
 +       __image_copy_end = .;


 Ditto for __image_copy_end.

This is the end of the region that needs to be copied when U-Boot is
relocated. The symbol exists in ARMv7 so I have reproduced it here. If
I read the SPL code correctly then it seems to need this.


 These two changes are unexplained in the commit message. Mind you, the one
 about CPUDIR and start.S isn't either... and it should, because once the
 commit is in, there is no indication left that it is part of a set, so
 readers will have a difficulty spotting the changes introduced.

OK I will take a look at these problems.


 But what bothers me most is that the patch set produces u-boot.bin files
 which are not binary identical to those produced without the patch set; if I
 remove the two assignments, then binary identity is preserved.

 Note: I check for binary identity by diff'ing hex dumps of u-boot.bin files
 produced with and without the patch set. If the only difference is the build
 version and date, I deem the files binary identical. The dump is done with
 'od -t x1z -A x u-boot.bin'.

 So unless there is a compelling and strictly unavoidable reason for these
 assignements, please drop them in the V3 patch set.

The binary will need to include values for these symbols in the dynsym
area, so adding a link symbol cannot produce an identical binary. But
the change should be harmless - it is just an extra symbol.

I do not want to drop these - in fact I want to standardize on these
(or something similar that we agree) across all architectures since it
makes the generic relocation code easier (at present it uses #ifdef to
work out what to do in the two different cases (SPL and non-SPL).
Ultimately we can look towards more uniformity across architectures in
the .lds files.

I will take another look at this series.


 Amicalement,
 --
 Albert.

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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Mike Frysinger
On Monday 20 February 2012 15:07:46 Tom Rini wrote:
 On Sun, Feb 19, 2012 at 02:15:30AM -0500, Mike Frysinger wrote:
  On Saturday 18 February 2012 17:03:59 Simon Glass wrote:
   On Wed, Feb 15, 2012 at 5:57 AM, Aneesh V wrote:
-.globl reset_cpu
+.type  reset_cpu, %function
+.globalreset_cpu
   
   Should we introduce a macro to deal with this rather than writing it
   out each time? EXPORT()?
  
  we have it already with the linux/linkage.h header :)
 
 Well, unless my tree is out of date (or stuff is in-flight) we don't
 have the full compliment here.  We have linux/linkage.h for all and
 asm/linkage.h for bfin.  That said, yes, we should grab at least the
 ARM version and make use of ENTRY/END_FUNC ala the kernel.  I'm behind
 on my convert __attribute__((...)) to __attr series already or I'd say
 more :)

yes, each arch is responsible for bringing in their asm/linkage.h needs into 
u-boot.  makes more sense to me to do that in arm than trying to hand modify a 
bunch of random funcs that people happen to notice issues with.
-mike


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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Mike Frysinger
On Monday 20 February 2012 16:53:40 Simon Glass wrote:
 On Mon, Feb 20, 2012 at 12:07 PM, Tom Rini wrote:
  On Sun, Feb 19, 2012 at 02:15:30AM -0500, Mike Frysinger wrote:
  On Saturday 18 February 2012 17:03:59 Simon Glass wrote:
   On Wed, Feb 15, 2012 at 5:57 AM, Aneesh V wrote:
-.globl reset_cpu
+.type  reset_cpu, %function
+.globalreset_cpu
   
   Should we introduce a macro to deal with this rather than writing it
   out each time? EXPORT()?
  
  we have it already with the linux/linkage.h header :)
  
  Well, unless my tree is out of date (or stuff is in-flight) we don't
  have the full compliment here.  We have linux/linkage.h for all and
  asm/linkage.h for bfin.  That said, yes, we should grab at least the
  ARM version and make use of ENTRY/END_FUNC ala the kernel.  I'm behind
  on my convert __attribute__((...)) to __attr series already or I'd say
  more :)
 
 In case one of you is going to look at this, can we try to use
 asm-generic as much as possible?

i don't know what you mean ... we already have linux/linkage.h with sane 
defaults for pretty much everyone.  the Blackfin asm/linkage.h is an empty file 
to satisfy building.
-mike


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


Re: [U-Boot] [PATCH v4 7/8] sandbox: Add flags for open() call

2012-02-20 Thread Simon Glass
Hi Mike,

On Wed, Feb 15, 2012 at 10:09 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Wednesday 15 February 2012 18:51:17 Simon Glass wrote:
 This provides a way for callers to create files for writing. We define
 flags which mirror the POSIX values.

 Another approach would be to translate the flags at runtime. Perhaps we can
 leave to whoever wants to port this to another OS?

 as i mentioned, this isn't a linux-vs-non-linux issue.  even linux ports
 themselves disagree on the open() flags.

Gosh.


 +#define OS_O_RDONLY  0
 +#define OS_O_WRONLY  1
 +#define OS_O_RDWR    2

 these are fine for linux as every port i see uses these values

 +#define OS_O_CREAT   0100

 as soon as you get beyond the extreme basics, you start seeing bitfield drift.
 not all linux arches define O_CREAT to 0100.  so i'd like to see logic similar
 to what i did for lseek().  i.e. make you bite the bullet :P.

Chomp. I will send a new patch. Sandbox does at least have few
time/code size constraints.

 -mike

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


[U-Boot] [PATCH v5 7/9] sandbox: Add flags for open() call

2012-02-20 Thread Simon Glass
This provides a way for callers to create files for writing. The flags
are translated at runtime, for the ones we support.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v3:
- Change open() flags enum to #define

Changes in v4:
- Change space to tab in os.h
- Remove unneeded declaration of struct sandbox_state in os.h

Changes in v5:
- Add belts-and-braces decode of OS_O_... flags

 arch/sandbox/cpu/os.c |   24 ++--
 include/os.h  |   17 +++--
 2 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 093e7dc..a5c1c0b 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -45,9 +45,29 @@ ssize_t os_write(int fd, const void *buf, size_t count)
return write(fd, buf, count);
 }
 
-int os_open(const char *pathname, int flags)
+int os_open(const char *pathname, int os_flags)
 {
-   return open(pathname, flags);
+   int flags;
+
+   switch (os_flags  OS_O_MASK) {
+   case OS_O_RDONLY:
+   default:
+   flags = O_RDONLY;
+   break;
+
+   case OS_O_WRONLY:
+   flags = O_WRONLY;
+   break;
+
+   case OS_O_RDWR:
+   flags = O_RDWR;
+   break;
+   }
+
+   if (os_flags  OS_O_CREAT)
+   flags |= O_CREAT;
+
+   return open(pathname, flags, 0777);
 }
 
 int os_close(int fd)
diff --git a/include/os.h b/include/os.h
index f3af4f0..16fb5de 100644
--- a/include/os.h
+++ b/include/os.h
@@ -1,4 +1,9 @@
 /*
+ * Operating System Interface
+ *
+ * This provides access to useful OS routines for the sandbox architecture.
+ * They are kept in a separate file so we can include system headers.
+ *
  * Copyright (c) 2011 The Chromium OS Authors.
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -19,12 +24,6 @@
  * MA 02111-1307 USA
  */
 
-/*
- * Operating System Interface
- *
- * This provides access to useful OS routines from the sandbox architecture
- */
-
 /**
  * Access to the OS read() system call
  *
@@ -45,6 +44,12 @@ ssize_t os_read(int fd, void *buf, size_t count);
  */
 ssize_t os_write(int fd, const void *buf, size_t count);
 
+#define OS_O_RDONLY0
+#define OS_O_WRONLY1
+#define OS_O_RDWR  2
+#define OS_O_MASK  3   /* Mask for read/write flags */
+#define OS_O_CREAT 0100
+
 /**
  * Access to the OS open() system call
  *
-- 
1.7.7.3

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


Re: [U-Boot] [PATCH 2/4] arm: add %function attribute to assembly functions

2012-02-20 Thread Simon Glass
Hi Mike,

On Mon, Feb 20, 2012 at 8:19 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Monday 20 February 2012 16:53:40 Simon Glass wrote:
 On Mon, Feb 20, 2012 at 12:07 PM, Tom Rini wrote:
  On Sun, Feb 19, 2012 at 02:15:30AM -0500, Mike Frysinger wrote:
  On Saturday 18 February 2012 17:03:59 Simon Glass wrote:
   On Wed, Feb 15, 2012 at 5:57 AM, Aneesh V wrote:
-.globl reset_cpu
+.type  reset_cpu, %function
+.global        reset_cpu
  
   Should we introduce a macro to deal with this rather than writing it
   out each time? EXPORT()?
 
  we have it already with the linux/linkage.h header :)
 
  Well, unless my tree is out of date (or stuff is in-flight) we don't
  have the full compliment here.  We have linux/linkage.h for all and
  asm/linkage.h for bfin.  That said, yes, we should grab at least the
  ARM version and make use of ENTRY/END_FUNC ala the kernel.  I'm behind
  on my convert __attribute__((...)) to __attr series already or I'd say
  more :)

 In case one of you is going to look at this, can we try to use
 asm-generic as much as possible?

 i don't know what you mean ... we already have linux/linkage.h with sane
 defaults for pretty much everyone.  the Blackfin asm/linkage.h is an empty 
 file
 to satisfy building.

That's fine then, thanks.

 -mike

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


[U-Boot] [PATCH 1/2] Revert ARM: AM33XX: Add AM33XX I2C driver support

2012-02-20 Thread tom . rini
From: Tom Rini tr...@ti.com

This reverts commit 498cbdfe62a8330f6c89765bdd15e60328a26511 as we need
to revert the i2c changes that add the support for the platform.

Cc: Heiko Schocher h...@denx.de
Cc: Patil, Rachna rac...@ti.com
Signed-off-by: Tom Rini tr...@ti.com
---
 drivers/i2c/omap24xx_i2c.c |   20 +++-
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index f06af02..80932ef 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -147,7 +147,7 @@ static void flush_fifo(void)
stat = readw(i2c_base-stat);
if (stat == I2C_STAT_RRDY) {
 #if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_OMAP44XX) || defined(CONFIG_AM33XX)
+   defined(CONFIG_OMAP44XX)
readb(i2c_base-data);
 #else
readw(i2c_base-data);
@@ -247,8 +247,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
switch (alen) {
case 2:
/* Send address MSByte */
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
writew(((addr  8)  0xFF), i2c_base-data);
 
/* Clearing XRDY event */
@@ -265,8 +264,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
}
 #endif
case 1:
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
/* Send address LSByte */
writew((addr  0xFF), i2c_base-data);
 #else
@@ -315,8 +313,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
}
 
if (status  I2C_STAT_RRDY) {
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
buffer[i] = readb(i2c_base-data);
 #else
*((u16 *)buffer[i]) =
@@ -403,8 +400,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
if (!i2c_error) {
if (status  I2C_STAT_XRDY) {
switch (alen) {
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
case 2:
/* send out MSB byte */
writeb(((addr  8)  0xFF), i2c_base-data);
@@ -424,8 +420,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
break;
}
case 1:
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
/* send out MSB byte */
writeb((addr   0xFF), i2c_base-data);
 #else
@@ -447,8 +442,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar 
*buffer, int len)
if (!i2c_error) {
for (i = ((alen  1) ? 0 : 1); i  len; i++) {
if (status  I2C_STAT_XRDY) {
-#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
-   defined(CONFIG_AM33XX)
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)
writeb((buffer[i]  0xFF),
i2c_base-data);
 #else
-- 
1.7.0.4

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


[U-Boot] [PATCH 2/2] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread tom . rini
From: Tom Rini tr...@ti.com

This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 as
this has introduced some large problems on all other platforms and have
more changes in them than the commit message implies.

Cc: Heiko Schocher h...@denx.de
Cc: Patil, Rachna rac...@ti.com
Signed-off-by: Tom Rini tr...@ti.com
---
 drivers/i2c/omap24xx_i2c.c |  467 
 drivers/i2c/omap24xx_i2c.h |2 -
 2 files changed, 173 insertions(+), 296 deletions(-)

diff --git a/drivers/i2c/omap24xx_i2c.c b/drivers/i2c/omap24xx_i2c.c
index 80932ef..a7ffd95 100644
--- a/drivers/i2c/omap24xx_i2c.c
+++ b/drivers/i2c/omap24xx_i2c.c
@@ -29,11 +29,10 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define I2C_STAT_TIMEO (1  31)
-#define I2C_TIMEOUT10
+#define I2C_TIMEOUT1000
 
-static u32 wait_for_bb(void);
-static u32 wait_for_status_mask(u16 mask);
+static void wait_for_bb(void);
+static u16 wait_for_pin(void);
 static void flush_fifo(void);
 
 /*
@@ -51,6 +50,7 @@ void i2c_init(int speed, int slaveadd)
int psc, fsscll, fssclh;
int hsscll = 0, hssclh = 0;
u32 scll, sclh;
+   int timeout = I2C_TIMEOUT;
 
/* Only handle standard, fast and high speeds */
if ((speed != OMAP_I2C_STANDARD) 
@@ -112,14 +112,24 @@ void i2c_init(int speed, int slaveadd)
sclh = (unsigned int)fssclh;
}
 
-   if (gd-flags  GD_FLG_RELOC)
-   bus_initialized[current_bus] = 1;
-
if (readw(i2c_base-con)  I2C_CON_EN) {
writew(0, i2c_base-con);
udelay(5);
}
 
+   writew(0x2, i2c_base-sysc); /* for ES2 after soft reset */
+   udelay(1000);
+
+   writew(I2C_CON_EN, i2c_base-con);
+   while (!(readw(i2c_base-syss)  I2C_SYSS_RDONE)  timeout--) {
+   if (timeout = 0) {
+   puts(ERROR: Timeout in soft-reset\n);
+   return;
+   }
+   udelay(1000);
+   }
+
+   writew(0, i2c_base-con);
writew(psc, i2c_base-psc);
writew(scll, i2c_base-scll);
writew(sclh, i2c_base-sclh);
@@ -135,6 +145,81 @@ void i2c_init(int speed, int slaveadd)
flush_fifo();
writew(0x, i2c_base-stat);
writew(0, i2c_base-cnt);
+
+   if (gd-flags  GD_FLG_RELOC)
+   bus_initialized[current_bus] = 1;
+}
+
+static int i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
+{
+   int i2c_error = 0;
+   u16 status;
+
+   /* wait until bus not busy */
+   wait_for_bb();
+
+   /* one byte only */
+   writew(1, i2c_base-cnt);
+   /* set slave address */
+   writew(devaddr, i2c_base-sa);
+   /* no stop bit needed here */
+   writew(I2C_CON_EN | I2C_CON_MST | I2C_CON_STT |
+ I2C_CON_TRX, i2c_base-con);
+
+   /* send register offset */
+   while (1) {
+   status = wait_for_pin();
+   if (status == 0 || status  I2C_STAT_NACK) {
+   i2c_error = 1;
+   goto read_exit;
+   }
+   if (status  I2C_STAT_XRDY) {
+   /* Important: have to use byte access */
+   writeb(regoffset, i2c_base-data);
+   writew(I2C_STAT_XRDY, i2c_base-stat);
+   }
+   if (status  I2C_STAT_ARDY) {
+   writew(I2C_STAT_ARDY, i2c_base-stat);
+   break;
+   }
+   }
+
+   /* set slave address */
+   writew(devaddr, i2c_base-sa);
+   /* read one byte from slave */
+   writew(1, i2c_base-cnt);
+   /* need stop bit here */
+   writew(I2C_CON_EN | I2C_CON_MST |
+   I2C_CON_STT | I2C_CON_STP,
+   i2c_base-con);
+
+   /* receive data */
+   while (1) {
+   status = wait_for_pin();
+   if (status == 0 || status  I2C_STAT_NACK) {
+   i2c_error = 1;
+   goto read_exit;
+   }
+   if (status  I2C_STAT_RRDY) {
+#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || \
+   defined(CONFIG_OMAP44XX)
+   *value = readb(i2c_base-data);
+#else
+   *value = readw(i2c_base-data);
+#endif
+   writew(I2C_STAT_RRDY, i2c_base-stat);
+   }
+   if (status  I2C_STAT_ARDY) {
+   writew(I2C_STAT_ARDY, i2c_base-stat);
+   break;
+   }
+   }
+
+read_exit:
+   flush_fifo();
+   writew(0x, i2c_base-stat);
+   writew(0, i2c_base-cnt);
+   return i2c_error;
 }
 
 static void flush_fifo(void)
@@ -161,42 +246,32 @@ static void flush_fifo(void)
 
 int i2c_probe(uchar chip)
 {
-   u32 status;
+   u16 status;
int res = 1; /* default = fail */
 
if (chip == readw(i2c_base-oa))
return res;
 
/* wait until bus not busy */
-  

Re: [U-Boot] [PATCH v5 7/9] sandbox: Add flags for open() call

2012-02-20 Thread Mike Frysinger
On Monday 20 February 2012 23:41:36 Simon Glass wrote:
 This provides a way for callers to create files for writing. The flags
 are translated at runtime, for the ones we support.

thanks, merged into my sandbox tree
-mike


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


[U-Boot] [PATCH] sandbox: add get_{tbclk,ticks}

2012-02-20 Thread Mike Frysinger
Fixes building after recent readline updates with timeouts.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 board/sandbox/sandbox/sandbox.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/sandbox/sandbox/sandbox.c b/board/sandbox/sandbox/sandbox.c
index f376c74..9883013 100644
--- a/board/sandbox/sandbox/sandbox.c
+++ b/board/sandbox/sandbox/sandbox.c
@@ -34,6 +34,16 @@ void flush_cache(unsigned long start, unsigned long size)
 {
 }
 
+ulong get_tbclk(void)
+{
+   return CONFIG_SYS_HZ;
+}
+
+unsigned long long get_ticks(void)
+{
+   return get_timer(0);
+}
+
 ulong get_timer(ulong base)
 {
return (os_get_nsec() / 100) - base;
-- 
1.7.8.4

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


[U-Boot] [PATCH 1/5 v2.2] sandbox: add lseek helper

2012-02-20 Thread Mike Frysinger
Follow up patches want to be able to seek fd's.

Acked-by: Simon Glass s...@chromium.org
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
v2.2
- added stdio.h include for printf() prototype

 arch/sandbox/cpu/os.c |   14 ++
 include/os.h  |   15 +++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 093e7dc..15f1f67 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -21,6 +21,7 @@
 
 #include errno.h
 #include fcntl.h
+#include stdio.h
 #include stdlib.h
 #include termios.h
 #include time.h
@@ -45,6 +46,19 @@ ssize_t os_write(int fd, const void *buf, size_t count)
return write(fd, buf, count);
 }
 
+off_t os_lseek(int fd, off_t offset, int whence)
+{
+   if (whence == OS_SEEK_SET)
+   whence = SEEK_SET;
+   else if (whence == OS_SEEK_CUR)
+   whence = SEEK_CUR;
+   else if (whence == OS_SEEK_END)
+   whence = SEEK_END;
+   else
+   printf(%s: invalid whence value %i\n, __func__, whence);
+   return lseek(fd, offset, whence);
+}
+
 int os_open(const char *pathname, int flags)
 {
return open(pathname, flags);
diff --git a/include/os.h b/include/os.h
index c17a8a5..f74766d 100644
--- a/include/os.h
+++ b/include/os.h
@@ -49,6 +49,21 @@ ssize_t os_read(int fd, void *buf, size_t count);
 ssize_t os_write(int fd, const void *buf, size_t count);
 
 /**
+ * Access to the OS lseek() system call
+ *
+ * \param fd   File descriptor as returned by os_open()
+ * \param offset   File offset (based on whence)
+ * \param whence   Position offset is relative to (see below)
+ * \return new file offset
+ */
+off_t os_lseek(int fd, off_t offset, int whence);
+
+/* Defines for whence in os_lseek() */
+#define OS_SEEK_SET0
+#define OS_SEEK_CUR1
+#define OS_SEEK_END2
+
+/**
  * Access to the OS open() system call
  *
  * \param pathname Pathname of file to open
-- 
1.7.8.4

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


Re: [U-Boot] [PATCH v2 2/8] sandbox: config: Enable fdt and snprintf() options

2012-02-20 Thread Mike Frysinger
On Wednesday 15 February 2012 01:26:10 Simon Glass wrote:
 On Tue, Jan 24, 2012 at 1:24 PM, Mike Frysinger wrote:
  On Monday 23 January 2012 00:30:32 Simon Glass wrote:
   On Fri, Jan 20, 2012 at 10:54 AM, Mike Frysinger wrote:
On Tuesday 10 January 2012 19:45:46 Simon Glass wrote:
+#define CONFIG_LMB

do we need this ?
   
   Without it I think bootm fails to build with FDT enabled.
  
  looks like CONFIG_OF_LIBFDT hard depends on CONFIG_LMB, and a lot of lmb
  stuff
  leaks when it isn't defined.  i think i'll send a patch to tighten up the
  lmb.h
  header when that define isn't available.
  -mike
 
 OK - did you do this? Just wondering if I should drop this CONFIG now...

i posted a patch, but we'll still need the lmb define
-mike


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


Re: [U-Boot] [PATCH v2 2/8] sandbox: config: Enable fdt and snprintf() options

2012-02-20 Thread Simon Glass
Hi Mike,

On Mon, Feb 20, 2012 at 9:24 PM, Mike Frysinger vap...@gentoo.org wrote:
 On Wednesday 15 February 2012 01:26:10 Simon Glass wrote:
 On Tue, Jan 24, 2012 at 1:24 PM, Mike Frysinger wrote:
  On Monday 23 January 2012 00:30:32 Simon Glass wrote:
   On Fri, Jan 20, 2012 at 10:54 AM, Mike Frysinger wrote:
On Tuesday 10 January 2012 19:45:46 Simon Glass wrote:
+#define CONFIG_LMB
   
do we need this ?
  
   Without it I think bootm fails to build with FDT enabled.
 
  looks like CONFIG_OF_LIBFDT hard depends on CONFIG_LMB, and a lot of lmb
  stuff
  leaks when it isn't defined.  i think i'll send a patch to tighten up the
  lmb.h
  header when that define isn't available.
  -mike

 OK - did you do this? Just wondering if I should drop this CONFIG now...

 i posted a patch, but we'll still need the lmb define

OK. So this patch stays as is?

 -mike

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


Re: [U-Boot] [PATCH v4 3/8] sandbox: gpio: Add basic driver for simulating GPIOs

2012-02-20 Thread Mike Frysinger
here's the incremental/full diff against your v4 showing the direction i think
things should end up at ... incremental inline below while full is attached.
-mike

diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 17e601d..aa2aa4c 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -20,9 +20,6 @@
  */
 
 #include common.h
-#include asm/io.h
-#include asm/bitops.h
-#include asm-generic/gpio.h
 #include asm/gpio.h
 
 /* Flags for each GPIO */
@@ -42,38 +39,59 @@ struct gpio_state {
 static struct gpio_state state[CONFIG_SANDBOX_GPIO_COUNT];
 
 /* Access routines for GPIO state */
-static u8 *get_gpio(unsigned gp)
+static u8 *get_gpio_flags(unsigned gp)
 {
-   assert(gp  CONFIG_SANDBOX_GPIO_COUNT);
+   if (gp = ARRAY_SIZE(state)) {
+   static u8 invalid_flags;
+   printf(sandbox_gpio: error: invalid gpio %u\n, gp);
+   return invalid_flags;
+   }
+
return state[gp].flags;
 }
 
 static int get_gpio_flag(unsigned gp, int flag)
 {
-   return (*get_gpio(gp)  flag) != 0;
+   return (*get_gpio_flags(gp)  flag) != 0;
 }
 
-static void set_gpio_flag(unsigned gp, int flag, int value)
+static int set_gpio_flag(unsigned gp, int flag, int value)
 {
-   u8 *gpio = get_gpio(gp);
+   u8 *gpio = get_gpio_flags(gp);
 
if (value)
*gpio |= flag;
else
*gpio = ~flag;
+
+   return 0;
 }
 
+static int check_reserved(unsigned gpio, const char *func)
+{
+   if (!get_gpio_flag(gpio, GPIOF_RESERVED)) {
+   printf(sandbox_gpio: %s: error: gpio %u not reserved\n,
+   func, gpio);
+   return -1;
+   }
+
+   return 0;
+}
+
+/*
+ * Back-channel sandbox-internal-only access to GPIO state
+ */
+
 int sandbox_gpio_get_value(unsigned gp)
 {
if (get_gpio_flag(gp, GPIOF_OUTPUT))
-   printf(sandbox_gpio: get_value on output GPIO %d\n, gp);
-   return *get_gpio(gp)  GPIOF_HIGH;
+   debug(sandbox_gpio: get_value on output gpio %u\n, gp);
+   return get_gpio_flag(gp, GPIOF_HIGH);
 }
 
 int sandbox_gpio_set_value(unsigned gp, int value)
 {
-   set_gpio_flag(gp, GPIOF_HIGH, value);
-   return 0;
+   return set_gpio_flag(gp, GPIOF_HIGH, value);
 }
 
 int sandbox_gpio_get_direction(unsigned gp)
@@ -83,95 +101,90 @@ int sandbox_gpio_get_direction(unsigned gp)
 
 int sandbox_gpio_set_direction(unsigned gp, int output)
 {
-   set_gpio_flag(gp, GPIOF_OUTPUT, output);
-   return 0;
+   return set_gpio_flag(gp, GPIOF_OUTPUT, output);
 }
 
-static int check_reserved(unsigned gpio, const char *op_name)
-{
-   if (!get_gpio_flag(gpio, GPIOF_RESERVED)) {
-   printf(sandbox_gpio: '%s' on unreserved GPIO\n, op_name);
-   return -1;
-   }
-
-   return 0;
-}
-
-/* These functions implement the public interface within U-Boot */
+/*
+ * These functions implement the public interface within U-Boot
+ */
 
 /* set GPIO port 'gp' as an input */
 int gpio_direction_input(unsigned gp)
 {
-   debug(%s: gp = %d\n, __func__, gp);
+   debug(%s: gp:%u\n, __func__, gp);
+
if (check_reserved(gp, __func__))
return -1;
-   set_gpio_flag(gp, GPIOF_OUTPUT, 0);
 
-   return 0;
+   return sandbox_gpio_set_direction(gp, 0);
 }
 
 /* set GPIO port 'gp' as an output, with polarity 'value' */
 int gpio_direction_output(unsigned gp, int value)
 {
-   debug(%s: gp = %d, value = %d\n, __func__, gp, value);
+   debug(%s: gp:%u, value = %d\n, __func__, gp, value);
+
if (check_reserved(gp, __func__))
return -1;
-   set_gpio_flag(gp, GPIOF_OUTPUT, 1);
-   set_gpio_flag(gp, GPIOF_HIGH, value);
 
-   return 0;
+   return sandbox_gpio_set_direction(gp, 1) |
+   sandbox_gpio_set_value(gp, value);
 }
 
 /* read GPIO IN value of port 'gp' */
 int gpio_get_value(unsigned gp)
 {
-   debug(%s: gp = %d\n, __func__, gp);
+   debug(%s: gp:%u\n, __func__, gp);
+
if (check_reserved(gp, __func__))
return -1;
-   if (get_gpio_flag(gp, GPIOF_OUTPUT))
-   printf(sandbox_gpio: get_value on output GPIO %d\n, gp);
 
-   return get_gpio_flag(gp, GPIOF_HIGH);
+   return sandbox_gpio_get_value(gp);
 }
 
 /* write GPIO OUT value to port 'gp' */
 int gpio_set_value(unsigned gp, int value)
 {
-   debug(%s: gp = %d, value = %d\n, __func__, gp, value);
+   debug(%s: gp:%u, value = %d\n, __func__, gp, value);
+
if (check_reserved(gp, __func__))
return -1;
-   if (get_gpio_flag(gp, GPIOF_OUTPUT)) {
-   set_gpio_flag(gp, GPIOF_HIGH, value);
-   } else {
-   printf(sandbox_gpio: set_value on input GPIO %d\n, gp);
+
+   if (!sandbox_gpio_get_direction(gp)) {
+   printf(sandbox_gpio: error: set_value on input gpio %u\n, gp);
return -1;
}
 
-   return 0;
+   

Re: [U-Boot] [PATCH v2 2/8] sandbox: config: Enable fdt and snprintf() options

2012-02-20 Thread Mike Frysinger
On Tuesday 21 February 2012 00:37:16 Simon Glass wrote:
 On Mon, Feb 20, 2012 at 9:24 PM, Mike Frysinger wrote:
  On Wednesday 15 February 2012 01:26:10 Simon Glass wrote:
  On Tue, Jan 24, 2012 at 1:24 PM, Mike Frysinger wrote:
   On Monday 23 January 2012 00:30:32 Simon Glass wrote:
On Fri, Jan 20, 2012 at 10:54 AM, Mike Frysinger wrote:
 On Tuesday 10 January 2012 19:45:46 Simon Glass wrote:
 +#define CONFIG_LMB
 
 do we need this ?

Without it I think bootm fails to build with FDT enabled.
   
   looks like CONFIG_OF_LIBFDT hard depends on CONFIG_LMB, and a lot of
   lmb stuff
   leaks when it isn't defined.  i think i'll send a patch to tighten up
   the lmb.h
   header when that define isn't available.
   -mike
  
  OK - did you do this? Just wondering if I should drop this CONFIG now...
  
  i posted a patch, but we'll still need the lmb define
 
 OK. So this patch stays as is?

correct ... i responded to your v4 that i merged this as is
-mike


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


[U-Boot] [PATCH v3 6/7] arm: add a common .lds link script

2012-02-20 Thread Simon Glass
Most ARM CPUs use a very similar link script. This adds a basic
script that can be used by most CPUs.

Two new symbols are introduced which are intended to eventually be
defined on all architectures to make things easier for generic relocation
and reduce special-case code for each architecture:

__text_start is the start of the text area (equivalent to the existing
_start on ARM). It marks the start of the region which must be copied
to a new location during relocation.

__image_copy_end is the end of the region which must be copied to a new
location during relocation. It is normally equal to the start of the BSS
region, but this can vary in some cases (SPL?). Making this an explicit
symbol on its own removes any ambiguity and permits common code to always
do the right thing.

This new script makes use of CPUDIR, now defined by both Makefile and
spl/Makefile, to find the directory containing the start.o object file,
which is always placed first in the image.

To permit MMU setup prior to relocation (as used by pxa) we add an area
to the link script which contains space for this. This is taken
from commit 7f4cfcf. CPUs can put the contents in there using their
start.S file. BTW, shouldn't that area be 16KB-aligned?

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v3:
- Add more comments in the commit message
- Add section for MMU area, as required by pxa

 arch/arm/cpu/u-boot.lds |   91 +++
 1 files changed, 91 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/u-boot.lds

diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
new file mode 100644
index 000..7a859fc
--- /dev/null
+++ b/arch/arm/cpu/u-boot.lds
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2004-2008 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, ga...@denx.de
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+OUTPUT_FORMAT(elf32-littlearm, elf32-littlearm, elf32-littlearm)
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+   . = 0x;
+
+   . = ALIGN(4);
+   .text :
+   {
+   __text_start = .;
+   CPUDIR/start.o (.text)
+   *(.text)
+   }
+
+   . = ALIGN(4);
+   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+
+   . = ALIGN(4);
+   .data : {
+   *(.data)
+   }
+
+   . = ALIGN(4);
+
+   . = .;
+   __u_boot_cmd_start = .;
+   .u_boot_cmd : { *(.u_boot_cmd) }
+   __u_boot_cmd_end = .;
+
+   . = ALIGN(4);
+
+   __image_copy_end = .;
+
+   .rel.dyn : {
+   __rel_dyn_start = .;
+   *(.rel*)
+   __rel_dyn_end = .;
+   }
+
+   .dynsym : {
+   __dynsym_start = .;
+   *(.dynsym)
+   }
+
+   _end = .;
+
+   . = ALIGN(4096);
+
+   .mmutable : {
+   *(.mmutable)
+   }
+
+   .bss __rel_dyn_start (OVERLAY) : {
+   __bss_start = .;
+   *(.bss)
+. = ALIGN(4);
+   __bss_end__ = .;
+   }
+
+   /DISCARD/ : { *(.dynstr*) }
+   /DISCARD/ : { *(.dynamic*) }
+   /DISCARD/ : { *(.plt*) }
+   /DISCARD/ : { *(.interp*) }
+   /DISCARD/ : { *(.gnu*) }
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v3 7/7] arm: Use common .lds file where possible

2012-02-20 Thread Simon Glass
Each cpu directory currently has its own .lds file. This is only needed
in most cases because the start.o file is in a different subdir.

Now that we can factor out this difference, we can move most cpus over
to the common .lds file.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v3:
- Rebase to master

 arch/arm/cpu/arm1136/u-boot.lds   |   89 -
 arch/arm/cpu/arm1176/u-boot.lds   |   78 
 arch/arm/cpu/arm720t/u-boot.lds   |   79 
 arch/arm/cpu/arm920t/u-boot.lds   |   88 
 arch/arm/cpu/arm925t/u-boot.lds   |   83 --
 arch/arm/cpu/arm926ejs/u-boot.lds |   80 -
 arch/arm/cpu/arm946es/u-boot.lds  |   80 -
 arch/arm/cpu/arm_intcm/u-boot.lds |   80 -
 arch/arm/cpu/armv7/u-boot.lds |   85 ---
 arch/arm/cpu/lh7a40x/u-boot.lds   |   80 -
 arch/arm/cpu/pxa/u-boot.lds   |   86 ---
 arch/arm/cpu/s3c44b0/u-boot.lds   |   80 -
 arch/arm/cpu/sa1100/u-boot.lds|   83 --
 13 files changed, 0 insertions(+), 1071 deletions(-)
 delete mode 100644 arch/arm/cpu/arm1136/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm1176/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm720t/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm920t/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm925t/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm926ejs/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm946es/u-boot.lds
 delete mode 100644 arch/arm/cpu/arm_intcm/u-boot.lds
 delete mode 100644 arch/arm/cpu/armv7/u-boot.lds
 delete mode 100644 arch/arm/cpu/lh7a40x/u-boot.lds
 delete mode 100644 arch/arm/cpu/pxa/u-boot.lds
 delete mode 100644 arch/arm/cpu/s3c44b0/u-boot.lds
 delete mode 100644 arch/arm/cpu/sa1100/u-boot.lds

diff --git a/arch/arm/cpu/arm1136/u-boot.lds b/arch/arm/cpu/arm1136/u-boot.lds
deleted file mode 100644
index d1e2851..000
--- a/arch/arm/cpu/arm1136/u-boot.lds
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * (C) Copyright 2009
- * Ilya Yanok, Emcraft Systems Ltd, ya...@emcraft.com
- *
- * Copyright (C) 2005-2007 Samsung Electronics
- * Kyungin Park kyugnmin.p...@samsung.com
- *
- * Copyright (c) 2004 Texas Instruments
- *
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, ga...@denx.de
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_FORMAT(elf32-littlearm, elf32-littlearm, elf32-littlearm)
-OUTPUT_ARCH(arm)
-ENTRY(_start)
-SECTIONS
-{
-   . = 0x;
-
-   . = ALIGN(4);
-   .text :
-   {
-   arch/arm/cpu/arm1136/start.o(.text)
-   *(.text)
-   }
-
-   . = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
-
-   . = ALIGN(4);
-   .data : {
-   *(.data)
-   }
-
-   . = ALIGN(4);
-
-   . = .;
-   __u_boot_cmd_start = .;
-   .u_boot_cmd : { *(.u_boot_cmd) }
-   __u_boot_cmd_end = .;
-
-   . = ALIGN(4);
-
-   .rel.dyn : {
-   __rel_dyn_start = .;
-   *(.rel*)
-   __rel_dyn_end = .;
-   }
-
-   .dynsym : {
-   __dynsym_start = .;
-   *(.dynsym)
-   }
-
-   _end = .;
-
-   .bss __rel_dyn_start (OVERLAY) : {
-   __bss_start = .;
-   *(.bss)
-. = ALIGN(4);
-   __bss_end__ = .;
-   }
-
-   /DISCARD/ : { *(.dynstr*) }
-   /DISCARD/ : { *(.dynamic*) }
-   /DISCARD/ : { *(.plt*) }
-   /DISCARD/ : { *(.interp*) }
-   /DISCARD/ : { *(.gnu*) }
-}
diff --git a/arch/arm/cpu/arm1176/u-boot.lds b/arch/arm/cpu/arm1176/u-boot.lds
deleted file mode 100644
index 27d6638..000
--- a/arch/arm/cpu/arm1176/u-boot.lds
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * (C) Copyright 2002-2004
- * Gary Jennejohn, DENX Software Engineering, ga...@denx.de
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; 

Re: [U-Boot] [PATCH v4 3/8] sandbox: gpio: Add basic driver for simulating GPIOs

2012-02-20 Thread Simon Glass
Hi Mike,

On Mon, Feb 20, 2012 at 10:11 PM, Mike Frysinger vap...@gentoo.org wrote:
 here's the incremental/full diff against your v4 showing the direction i think
 things should end up at ... incremental inline below while full is attached.
 -mike

Hmmm I'm fine with the get_gpio_flags() rename, printf() changes, but
please see below.


 diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
 index 17e601d..aa2aa4c 100644
 --- a/drivers/gpio/sandbox.c
 +++ b/drivers/gpio/sandbox.c
 @@ -20,9 +20,6 @@
  */

  #include common.h
 -#include asm/io.h
 -#include asm/bitops.h
 -#include asm-generic/gpio.h
  #include asm/gpio.h

  /* Flags for each GPIO */
 @@ -42,38 +39,59 @@ struct gpio_state {
  static struct gpio_state state[CONFIG_SANDBOX_GPIO_COUNT];

  /* Access routines for GPIO state */
 -static u8 *get_gpio(unsigned gp)
 +static u8 *get_gpio_flags(unsigned gp)
  {
 -       assert(gp  CONFIG_SANDBOX_GPIO_COUNT);
 +       if (gp = ARRAY_SIZE(state)) {
 +               static u8 invalid_flags;
 +               printf(sandbox_gpio: error: invalid gpio %u\n, gp);
 +               return invalid_flags;
 +       }
 +

I think we want to die / fail the test here, but since we don't have
any tests I suppose this is ok for now. I like assert() because it
halts.

        return state[gp].flags;
  }

  static int get_gpio_flag(unsigned gp, int flag)
  {
 -       return (*get_gpio(gp)  flag) != 0;
 +       return (*get_gpio_flags(gp)  flag) != 0;
  }

 -static void set_gpio_flag(unsigned gp, int flag, int value)
 +static int set_gpio_flag(unsigned gp, int flag, int value)
  {
 -       u8 *gpio = get_gpio(gp);
 +       u8 *gpio = get_gpio_flags(gp);

        if (value)
                *gpio |= flag;
        else
                *gpio = ~flag;
 +
 +       return 0;
  }

 +static int check_reserved(unsigned gpio, const char *func)
 +{
 +       if (!get_gpio_flag(gpio, GPIOF_RESERVED)) {
 +               printf(sandbox_gpio: %s: error: gpio %u not reserved\n,
 +                       func, gpio);
 +               return -1;
 +       }
 +
 +       return 0;
 +}
 +
 +/*
 + * Back-channel sandbox-internal-only access to GPIO state
 + */
 +
  int sandbox_gpio_get_value(unsigned gp)
  {
        if (get_gpio_flag(gp, GPIOF_OUTPUT))
 -               printf(sandbox_gpio: get_value on output GPIO %d\n, gp);
 -       return *get_gpio(gp)  GPIOF_HIGH;
 +               debug(sandbox_gpio: get_value on output gpio %u\n, gp);
 +       return get_gpio_flag(gp, GPIOF_HIGH);
  }

  int sandbox_gpio_set_value(unsigned gp, int value)
  {
 -       set_gpio_flag(gp, GPIOF_HIGH, value);
 -       return 0;
 +       return set_gpio_flag(gp, GPIOF_HIGH, value);
  }

  int sandbox_gpio_get_direction(unsigned gp)
 @@ -83,95 +101,90 @@ int sandbox_gpio_get_direction(unsigned gp)

  int sandbox_gpio_set_direction(unsigned gp, int output)
  {
 -       set_gpio_flag(gp, GPIOF_OUTPUT, output);
 -       return 0;
 +       return set_gpio_flag(gp, GPIOF_OUTPUT, output);
  }

 -static int check_reserved(unsigned gpio, const char *op_name)
 -{
 -       if (!get_gpio_flag(gpio, GPIOF_RESERVED)) {
 -               printf(sandbox_gpio: '%s' on unreserved GPIO\n, op_name);
 -               return -1;
 -       }
 -
 -       return 0;
 -}
 -
 -/* These functions implement the public interface within U-Boot */
 +/*
 + * These functions implement the public interface within U-Boot
 + */

  /* set GPIO port 'gp' as an input */
  int gpio_direction_input(unsigned gp)
  {
 -       debug(%s: gp = %d\n, __func__, gp);
 +       debug(%s: gp:%u\n, __func__, gp);
 +
        if (check_reserved(gp, __func__))
                return -1;
 -       set_gpio_flag(gp, GPIOF_OUTPUT, 0);

 -       return 0;
 +       return sandbox_gpio_set_direction(gp, 0);

Ick, we shouldn't call that function here - it is in the test code. Same below.

The idea is that this state has two completely separate sides to it -
by calling the 'test' functions from the 'U-Boot' functions I think
you are going to confuse people a lot.

  }

  /* set GPIO port 'gp' as an output, with polarity 'value' */
  int gpio_direction_output(unsigned gp, int value)
  {
 -       debug(%s: gp = %d, value = %d\n, __func__, gp, value);
 +       debug(%s: gp:%u, value = %d\n, __func__, gp, value);
 +
        if (check_reserved(gp, __func__))
                return -1;
 -       set_gpio_flag(gp, GPIOF_OUTPUT, 1);
 -       set_gpio_flag(gp, GPIOF_HIGH, value);

 -       return 0;
 +       return sandbox_gpio_set_direction(gp, 1) |
 +               sandbox_gpio_set_value(gp, value);
  }

  /* read GPIO IN value of port 'gp' */
  int gpio_get_value(unsigned gp)
  {
 -       debug(%s: gp = %d\n, __func__, gp);
 +       debug(%s: gp:%u\n, __func__, gp);
 +
        if (check_reserved(gp, __func__))
                return -1;
 -       if (get_gpio_flag(gp, GPIOF_OUTPUT))
 -               printf(sandbox_gpio: get_value on output GPIO %d\n, gp);

 -       return get_gpio_flag(gp, GPIOF_HIGH);
 +       return 

Re: [U-Boot] [PATCH 1/2] Revert ARM: AM33XX: Add AM33XX I2C driver support

2012-02-20 Thread Heiko Schocher
Hello Tom,

tom.r...@gmail.com wrote:
 From: Tom Rini tr...@ti.com
 
 This reverts commit 498cbdfe62a8330f6c89765bdd15e60328a26511 as we need
 to revert the i2c changes that add the support for the platform.
 
 Cc: Heiko Schocher h...@denx.de
 Cc: Patil, Rachna rac...@ti.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
  drivers/i2c/omap24xx_i2c.c |   20 +++-
  1 files changed, 7 insertions(+), 13 deletions(-)

Applied to u-boot-i2c.git

Thanks!

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] [PATCH 2/2] Revert ARM: I2C: I2C Multi byte address support

2012-02-20 Thread Heiko Schocher
Hello Tom,

tom.r...@gmail.com wrote:
 From: Tom Rini tr...@ti.com
 
 This reverts commits 2faa76196af4b3e93bcb9e38ed9090cbd3b06db3 as
 this has introduced some large problems on all other platforms and have
 more changes in them than the commit message implies.
 
 Cc: Heiko Schocher h...@denx.de
 Cc: Patil, Rachna rac...@ti.com
 Signed-off-by: Tom Rini tr...@ti.com
 ---
  drivers/i2c/omap24xx_i2c.c |  467 
 
  drivers/i2c/omap24xx_i2c.h |2 -
  2 files changed, 173 insertions(+), 296 deletions(-)

Applied to u-boot-i2c.git.

Thanks!

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] WIP: fdt: Add serial port controlled by device tree

2012-02-20 Thread Simon Glass
This adds a new console serial port which is implemented by the driver
selected in the device tree. It works by redirecting to another driver.
It might be useful while we don't have proper serial device model and
the drivers that do exist don't understand the device tree.

This patch is provided to assist Hanumant hanuman...@gmail.com. A
suitable fdt fragment might be something like:

aliases {
console = /serial@70006300;
};

serial@70006300 {
compatible = nvidia,tegra250-uart, ns16550;
reg = 0x70006000 0x40;
id = 0;
reg-shift = 2;
interrupts =  68 ;
clock-frequency = 21600;
};

Signed-off-by: Simon Glass s...@chromium.org
---
 common/fdt_decode.c |  214 
 drivers/serial/Makefile |1 +
 drivers/serial/serial_fdt.c |  228 +++
 include/fdtdec.h|1 +
 include/serial_fdt.h|   36 +++
 lib/fdtdec.c|1 +
 6 files changed, 481 insertions(+), 0 deletions(-)
 create mode 100644 common/fdt_decode.c
 create mode 100644 drivers/serial/serial_fdt.c
 create mode 100644 include/serial_fdt.h

diff --git a/common/fdt_decode.c b/common/fdt_decode.c
new file mode 100644
index 000..2541147
--- /dev/null
+++ b/common/fdt_decode.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include serial.h
+#include libfdt.h
+#include fdt_support.h
+#include fdt_decode.h
+
+/*
+ * Here are the type we know about. One day we might allow drivers to
+ * register. For now we just put them here.
+ */
+static struct fdt_compat compat_types[] = {
+   { COMPAT_UNKNOWN, none },
+   { COMPAT_SPI_UART_SWITCH, spi-uart-select },
+   { COMPAT_SERIAL_NS16550, ns16550 },
+};
+
+/**
+ * Look in the FDT for an alias with the given name and return its node.
+ *
+ * @param blob FDT blob
+ * @param name alias name to look up
+ * @return node offset if found, or an error code  0 otherwise
+ */
+static int find_alias_node(const void *blob, const char *name)
+{
+   const char *path;
+   int alias_node;
+
+   alias_node = fdt_path_offset(blob, /aliases);
+   if (alias_node  0)
+   return alias_node;
+   path = fdt_getprop(blob, alias_node, name, NULL);
+   if (!path)
+   return -FDT_ERR_NOTFOUND;
+   return fdt_path_offset(blob, path);
+}
+
+/**
+ * Look up an address property in a node and return it as an address.
+ * The property must hold exactly one address with no trailing data.
+ * This is only tested on 32-bit machines.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @return address, if found, or ADDR_T_NONE if not
+ */
+static addr_t get_addr(const void *blob, int node, const char *prop_name)
+{
+   const addr_t *cell;
+   int len;
+
+   cell = fdt_getprop(blob, node, prop_name, len);
+   if (cell  len != sizeof(addr_t))
+   return addr_to_cpu(*cell);
+   return ADDR_T_NONE;
+}
+
+/**
+ * Look up a 32-bit integer property in a node and return it. The property
+ * must have at least 4 bytes of data. The value of the first cell is
+ * returned.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param default_val  default value to return if the property is not found
+ * @return integer value, if found, or default_val if not
+ */
+static s32 get_int(const void *blob, int node, const char *prop_name,
+   s32 default_val)
+{
+   const s32 *cell;
+   int len;
+
+   cell = fdt_getprop(blob, node, prop_name, len);
+   if (cell  len = sizeof(s32))
+   return fdt32_to_cpu(cell[0]);
+   return default_val;
+}
+
+/**
+ * Look up a phandle and follow it to its node. Then return the offset
+ * of that node.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @return node offset if found, -ve error 

Re: [U-Boot] serial : Device tree support for multiple serial devices.

2012-02-20 Thread Simon Glass
Hi,

On Mon, Jan 30, 2012 at 3:18 PM, hanumant hanuman...@gmail.com wrote:
 On 1/30/2012 10:35 AM, Simon Glass wrote:

 What I did for now was to implement a new fdt_serial.c file which
 defines 4 separate sets of function (each set containing putc, getc,
 etc.) with the device pointer built in to those functions. It's really
 ugly, and is what eserial does. Those functions look up the device
 tree during init and redirect to the real serial driver's functions of
 the same name.

 I could probably rustle up a patch if it would help.


 Thank you a patch would help a great deal.

Maybe too late to be useful, but I have finally got to this, and sent
a patch to the list.


 Thanks
 hanumant

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


Re: [U-Boot] [PATCH] nand: reinstate lazy bad block scanning

2012-02-20 Thread Heiko Schocher
Hello Scott,

Scott Wood wrote:
 commit 2a8e0fc8b3dc31a3c571e439fbf04b882c8986be (nand: Merge changes
 from Linux nand driver) accidentally reverted commit
 13f0fd94e3cae6f8a0d9fba5d367e311edc8ebde (NAND: Scan bad blocks
 lazily.).
 
 Reinstate the change, as amended by commit
 ff49ea8977b56916edd5b1766d9939010e30b181 (NAND: Mark the BBT as scanned
 prior to calling scan_bbt.).
 
 Signed-off-by: Scott Wood scottw...@freescale.com
 ---
  drivers/mtd/nand/nand_base.c |   10 +++---
  include/linux/mtd/nand.h |2 ++
  2 files changed, 9 insertions(+), 3 deletions(-)

Thanks!

Tested on the enbw_cmc board.

Acked-by: Heiko Schocher h...@denx.de
Tested-by: Heiko Schocher h...@denx.de

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] [i2c] Pull request

2012-02-20 Thread Heiko Schocher
Hello Wolfgang,

The following changes since commit 2acca35ce4604dcef933f07d90aa9c9c930e1049:

  Merge branch 'master' of git://git.denx.de/u-boot-mmc (2012-02-17 23:54:46 
+0100)

are available in the git repository at:

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

Tom Rini (2):
  Revert ARM: AM33XX: Add AM33XX I2C driver support
  Revert ARM: I2C: I2C Multi byte address support

 drivers/i2c/omap24xx_i2c.c |  475 
 drivers/i2c/omap24xx_i2c.h |2 -
 2 files changed, 174 insertions(+), 303 deletions(-)

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] [PATCH 11/17] OMAP5: defconfig: Align the defconfig for 5430 ES1.0

2012-02-20 Thread R, Sricharan
Hi Tom,

On Mon, Feb 20, 2012 at 11:15 PM, Tom Rini tr...@ti.com wrote:

 On Fri, Feb 17, 2012 at 05:35:27PM +0530, R Sricharan wrote:

  Adding the nessecary changes for OMAP5430 ES1.0 silicon.
 
  Signed-off-by: R Sricharan r.sricha...@ti.com
 [snip]
  +/* OPP SETTING */
  +#define OPP_NOM

 Where is this used?
 Right. This is unused. Will remove this. We were having

   OPP_LOW and OPP_HIGH settings in the clocks table, for internal testing.
   But that being eventually removed, this is not required.


 [snip]
   /* Defines for SPL */
   #define CONFIG_SPL
  -#define CONFIG_SPL_TEXT_BASE 0x40304350
  -#define CONFIG_SPL_MAX_SIZE  0x1E000 /* 120K */
  +#define CONFIG_SPL_TEXT_BASE 0x40300350
  +#define CONFIG_SPL_MAX_SIZE  0x2 /* 128K */
   #define CONFIG_SPL_STACK LOW_LEVEL_SRAM_STACK

 This is wrong, you have to account for stack within SPL_MAX_SIZE.

 To understand,
So now, LOW_LEVEL_SRAM_STACK points to SRAM base + 128KB address (which
is the SRAM size),
pointed to by NON_SECURE_SRAM_END
   Should this be changed ?
   Also CONFIG_SYS_INIT_SP_ADDR should be adjusted. Will change this

 --
 Tom

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


  1   2   >