All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: mvebu: a38x: Weed out floating point use
Date: Fri, 20 May 2016 11:04:46 +0200	[thread overview]
Message-ID: <573ED32E.2000404@denx.de> (raw)
In-Reply-To: <1462020342-4851-1-git-send-email-marex@denx.de>

On 30.04.2016 14:45, Marek Vasut wrote:
> For reason unknown, recently, the DDR init code writers are really fond
> of hiding some small floating point operating deep in their creations.
> This patch removes one from the Marvell A38x code.
>
> Instead of returning size of chip as float from ddr3_get_device_size()
> in GiB units, return it as int in MiB units. Since this would interfere
> with the huge switch code in ddr3_calc_mem_cs_size(), rework the code
> to match the change.
>
> Before this patch, the cs_mem_size variable could have these values:
>   ( { 16, 32 } x { 8, 16 } x { 0.01, 0.5, 1, 2, 4, 8 } ) / 8 =
>     { 0.000000, 0.001250, 0.002500, 0.005000, 0.062500, 0.125000,
>       0.250000, 0.500000, 1.000000, 2.000000, 4.000000, }
> The switch code checked for a subset of the resulting RAM sizes, which
> is in range 128 MiB ... 2048 MiB.
>
> With this patch, the cs_mem_size variable can have these values:
>   ( { 16, 32 } x { 8, 16 } x { 0, 512, 1024, 2048, 4096, 8192 } ) / 8 =
>     { 0, 64, 128, 256, 512, 1024, 2048, 4096 }
> To retain previous behavior, filter out 0 MiB (invalid size), 64 MiB
> and 4096 MiB options.
>
> Removing the floating point stuff also saves 1.5k from text segment:
>    clearfog       :  spl/u-boot-spl:all -1592  spl/u-boot-spl:text -1592
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Dirk Eibach <dirk.eibach@gdsys.cc>
> Cc: Stefan Roese <sr@denx.de>

Marek, thanks for working on this.

Applied to u-boot-marvell/master

Thanks,
Stefan

      parent reply	other threads:[~2016-05-20  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 12:45 [U-Boot] [PATCH] arm: mvebu: a38x: Weed out floating point use Marek Vasut
2016-05-19 23:46 ` Marek Vasut
2016-05-20  9:04 ` Stefan Roese [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573ED32E.2000404@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.