public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot]  [PULL] : Please pull u-boot-i2c
@ 2013-01-29  7:41 Heiko Schocher
  2013-01-29  8:44 ` [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr Luca Ellero
  2013-01-29 22:15 ` [U-Boot] [PULL] : Please pull u-boot-i2c Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Heiko Schocher @ 2013-01-29  7:41 UTC (permalink / raw)
  To: u-boot

Hello Tom,

please pull from u-boot-i2c:

The following changes since commit 54b08efcf2f4ff532ce99c53f341a59c193331a5:

  README.mips: update known issues and TODOs (2013-01-16 10:52:08 +0100)

are available in the git repository at:

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

for you to fetch changes up to 019be4af642cf59df0fa97082e5d9e290d26f997:

  Remove unused CONFIG_SYS_I2C_BUS[_SELECT] (2013-01-29 06:40:01 +0100)

----------------------------------------------------------------
Marek Vasut (1):
      i2c: mxs: Staticize the functions in the driver

Michael Jones (1):
      Remove unused CONFIG_SYS_I2C_BUS[_SELECT]

 drivers/i2c/mxs_i2c.c              | 8 ++++----
 include/configs/am3517_crane.h     | 2 --
 include/configs/am3517_evm.h       | 2 --
 include/configs/cm_t35.h           | 2 --
 include/configs/devkit8000.h       | 2 --
 include/configs/dig297.h           | 2 --
 include/configs/igep00x0.h         | 2 --
 include/configs/mcx.h              | 1 -
 include/configs/omap3_beagle.h     | 2 --
 include/configs/omap3_evm_common.h | 2 --
 include/configs/omap3_logic.h      | 2 --
 include/configs/omap3_mvblx.h      | 2 --
 include/configs/omap3_pandora.h    | 2 --
 include/configs/omap3_sdp3430.h    | 2 --
 include/configs/omap3_zoom1.h      | 2 --
 include/configs/omap3_zoom2.h      | 2 --
 include/configs/omap4_common.h     | 2 --
 include/configs/tam3517-common.h   | 2 --
 include/configs/tricorder.h        | 2 --
 19 Dateien ge?ndert, 4 Zeilen hinzugef?gt(+), 39 Zeilen entfernt(-)

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr
  2013-01-29  7:41 [U-Boot] [PULL] : Please pull u-boot-i2c Heiko Schocher
@ 2013-01-29  8:44 ` Luca Ellero
  2013-01-29  9:48   ` Wolfgang Denk
  2013-01-29 22:15 ` [U-Boot] [PULL] : Please pull u-boot-i2c Tom Rini
  1 sibling, 1 reply; 5+ messages in thread
From: Luca Ellero @ 2013-01-29  8:44 UTC (permalink / raw)
  To: u-boot


Hi all,
in U-Boot version 2012.10 I used to skip "relocate_code" setting 
CONFIG_SYS_TEXT_BASE to relocaddr (obtained from bdinfo command).
This since some hardware is able to configure SDRAM and load U-Boot 
directly to SDRAM, so relocation is useless and time consuming.
Now I'm using latest git version and this isn't working anymore.
Can someone explain me way? And what is the suggested way to skip 
relocation now.
Thanks in advance
Best regards
Luca Ellero

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr
  2013-01-29  8:44 ` [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr Luca Ellero
@ 2013-01-29  9:48   ` Wolfgang Denk
  2013-01-29 15:16     ` Luca Ellero
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2013-01-29  9:48 UTC (permalink / raw)
  To: u-boot

Dear Luca Ellero,

In message <51078BFD.60906@gmail.com> you wrote:
> 
> in U-Boot version 2012.10 I used to skip "relocate_code" setting 
> CONFIG_SYS_TEXT_BASE to relocaddr (obtained from bdinfo command).
> This since some hardware is able to configure SDRAM and load U-Boot 
> directly to SDRAM, so relocation is useless and time consuming.

You are wrong.  relocation is not useless, even in your case.  there
are quite a number of configuration options that will put stuff above
the U-Boot image, directly at the end of RAM (things like protected
RAM, shared frame buffer, shared log buffer, etc.).  In these cases,
the relocation address may even be dynamic (i. e. depending on
settings of environment variables, and thus unknown at compile time).

> Now I'm using latest git version and this isn't working anymore.
> Can someone explain me way? And what is the suggested way to skip 
> relocation now.

Don't.

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: wd at denx.de
The Empire didn't encourage its subjects to go far away, in case they
saw things that might disturb them. For the same reason it had  built
a  wall  around  the  entire country, patrolled by the Heavenly Guard
whose main function was to tread heavily on the fingers of any  inha-
bitants who felt they might like to step outside for five minutes for
a breath of fresh air.                      - Terry Pratchett, _Mort_

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr
  2013-01-29  9:48   ` Wolfgang Denk
@ 2013-01-29 15:16     ` Luca Ellero
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Ellero @ 2013-01-29 15:16 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On 29/01/2013 10.48, Wolfgang Denk wrote:
> Dear Luca Ellero,
>
> In message <51078BFD.60906@gmail.com> you wrote:
>>
>> in U-Boot version 2012.10 I used to skip "relocate_code" setting
>> CONFIG_SYS_TEXT_BASE to relocaddr (obtained from bdinfo command).
>> This since some hardware is able to configure SDRAM and load U-Boot
>> directly to SDRAM, so relocation is useless and time consuming.
>
> You are wrong.  relocation is not useless, even in your case.  there
> are quite a number of configuration options that will put stuff above
> the U-Boot image, directly at the end of RAM (things like protected
> RAM, shared frame buffer, shared log buffer, etc.).  In these cases,
> the relocation address may even be dynamic (i. e. depending on
> settings of environment variables, and thus unknown at compile time).
>
>> Now I'm using latest git version and this isn't working anymore.
>> Can someone explain me way? And what is the suggested way to skip
>> relocation now.
>
> Don't.

Got your point ;-)
Thanks
I'm asking that since I'm digging on ARM SDRAM configuration and found a 
bug on getting top of SDRAM (where u-boot will be relocated).

On ARM architectures top of SDRAM will always be:

CONFIG_SYS_SDRAM_BASE + gd->ram_size

anyway this can be wrong since SDRAM can be composed by more that one 
bank in not-contiguous address space.
(CONFIG_SYS_SDRAM_BASE + gd->ram_size) can land to not existent SDRAM 
addresses and can be very dangerous since it can potentially corrupt 
real SDRAM (in most cases SDRAM is aliased so writing to some 
not-existent address can write to real address).


My proposed patch is something like this:
---------------------------------------------------------

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index cfe32cc..7525caf 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -333,7 +333,18 @@ void board_init_f(ulong bootflag)
  	gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
  #endif

+#if defined(PHYS_SDRAM_2) && defined(PHYS_SDRAM_2_SIZE)
+	if ( CONFIG_NR_DRAM_BANKS > 1 &&
+		(PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE) != PHYS_SDRAM_2 )
+		addr =  PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE;
+	else
+		addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
+#else
  	addr = CONFIG_SYS_SDRAM_BASE + gd->ram_size;
+#endif
+

---------------------------------------------------------

I know that some arch use more than 2 banks but implementing all macros 
checks to PHYS_SDRAM_* leads to some macro hell. So the point here is:

if (n banks > 2) and they are not contiguous, relocate u-boot at the end 
of 2nd bank even if there are more than 2 banks.

Please suggest me if this is the right way to follow or suggest me some 
more appropriate way to correct this bug
Thanks again
Regards
Luca Ellero

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PULL] : Please pull u-boot-i2c
  2013-01-29  7:41 [U-Boot] [PULL] : Please pull u-boot-i2c Heiko Schocher
  2013-01-29  8:44 ` [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr Luca Ellero
@ 2013-01-29 22:15 ` Tom Rini
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2013-01-29 22:15 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 29, 2013 at 08:41:26AM +0100, Heiko Schocher wrote:

> Hello Tom,
> 
> please pull from u-boot-i2c:
> 
> The following changes since commit 54b08efcf2f4ff532ce99c53f341a59c193331a5:
> 
>   README.mips: update known issues and TODOs (2013-01-16 10:52:08 +0100)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-i2c.git master
> 
> for you to fetch changes up to 019be4af642cf59df0fa97082e5d9e290d26f997:
> 
>   Remove unused CONFIG_SYS_I2C_BUS[_SELECT] (2013-01-29 06:40:01 +0100)
> 
> ----------------------------------------------------------------
> Marek Vasut (1):
>       i2c: mxs: Staticize the functions in the driver
> 
> Michael Jones (1):
>       Remove unused CONFIG_SYS_I2C_BUS[_SELECT]
> 
>  drivers/i2c/mxs_i2c.c              | 8 ++++----
>  include/configs/am3517_crane.h     | 2 --
>  include/configs/am3517_evm.h       | 2 --
>  include/configs/cm_t35.h           | 2 --
>  include/configs/devkit8000.h       | 2 --
>  include/configs/dig297.h           | 2 --
>  include/configs/igep00x0.h         | 2 --
>  include/configs/mcx.h              | 1 -
>  include/configs/omap3_beagle.h     | 2 --
>  include/configs/omap3_evm_common.h | 2 --
>  include/configs/omap3_logic.h      | 2 --
>  include/configs/omap3_mvblx.h      | 2 --
>  include/configs/omap3_pandora.h    | 2 --
>  include/configs/omap3_sdp3430.h    | 2 --
>  include/configs/omap3_zoom1.h      | 2 --
>  include/configs/omap3_zoom2.h      | 2 --
>  include/configs/omap4_common.h     | 2 --
>  include/configs/tam3517-common.h   | 2 --
>  include/configs/tricorder.h        | 2 --
>  19 Dateien ge?ndert, 4 Zeilen hinzugef?gt(+), 39 Zeilen entfernt(-)

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130129/850c1838/attachment.pgp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-29 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29  7:41 [U-Boot] [PULL] : Please pull u-boot-i2c Heiko Schocher
2013-01-29  8:44 ` [U-Boot] CONFIG_SYS_TEXT_BASE and relocaddr Luca Ellero
2013-01-29  9:48   ` Wolfgang Denk
2013-01-29 15:16     ` Luca Ellero
2013-01-29 22:15 ` [U-Boot] [PULL] : Please pull u-boot-i2c Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox