Patchwork [v2a] musicpal: Fix flash mapping

login
register
mail settings
Submitter Jan Kiszka
Date Sept. 8, 2012, 9:52 a.m.
Message ID <504B1567.6000106@web.de>
Download mbox | patch
Permalink /patch/182532/
State New
Headers show

Comments

Jan Kiszka - Sept. 8, 2012, 9:52 a.m.
The old arithmetic assumed 32 physical address bits which is no longer
true for ARM since 3cc0cd61f4.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---

Changes in v2a:
- mark large constant ULL

 hw/musicpal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Blue Swirl - Sept. 8, 2012, 10:19 a.m.
Thanks, applied.

On Sat, Sep 8, 2012 at 9:52 AM, Jan Kiszka <jan.kiszka@web.de> wrote:
> The old arithmetic assumed 32 physical address bits which is no longer
> true for ARM since 3cc0cd61f4.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
> ---
>
> Changes in v2a:
> - mark large constant ULL
>
>  hw/musicpal.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/musicpal.c b/hw/musicpal.c
> index ad725b5..f305e21 100644
> --- a/hw/musicpal.c
> +++ b/hw/musicpal.c
> @@ -1583,7 +1583,7 @@ static void musicpal_init(ram_addr_t ram_size,
>           * image is smaller than 32 MB.
>           */
>  #ifdef TARGET_WORDS_BIGENDIAN
> -        pflash_cfi02_register(0-MP_FLASH_SIZE_MAX, NULL,
> +        pflash_cfi02_register(0x100000000ULL-MP_FLASH_SIZE_MAX, NULL,
>                                "musicpal.flash", flash_size,
>                                dinfo->bdrv, 0x10000,
>                                (flash_size + 0xffff) >> 16,
> @@ -1591,7 +1591,7 @@ static void musicpal_init(ram_addr_t ram_size,
>                                2, 0x00BF, 0x236D, 0x0000, 0x0000,
>                                0x5555, 0x2AAA, 1);
>  #else
> -        pflash_cfi02_register(0-MP_FLASH_SIZE_MAX, NULL,
> +        pflash_cfi02_register(0x100000000ULL-MP_FLASH_SIZE_MAX, NULL,
>                                "musicpal.flash", flash_size,
>                                dinfo->bdrv, 0x10000,
>                                (flash_size + 0xffff) >> 16,
> --
> 1.7.3.4

Patch

diff --git a/hw/musicpal.c b/hw/musicpal.c
index ad725b5..f305e21 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1583,7 +1583,7 @@  static void musicpal_init(ram_addr_t ram_size,
          * image is smaller than 32 MB.
          */
 #ifdef TARGET_WORDS_BIGENDIAN
-        pflash_cfi02_register(0-MP_FLASH_SIZE_MAX, NULL,
+        pflash_cfi02_register(0x100000000ULL-MP_FLASH_SIZE_MAX, NULL,
                               "musicpal.flash", flash_size,
                               dinfo->bdrv, 0x10000,
                               (flash_size + 0xffff) >> 16,
@@ -1591,7 +1591,7 @@  static void musicpal_init(ram_addr_t ram_size,
                               2, 0x00BF, 0x236D, 0x0000, 0x0000,
                               0x5555, 0x2AAA, 1);
 #else
-        pflash_cfi02_register(0-MP_FLASH_SIZE_MAX, NULL,
+        pflash_cfi02_register(0x100000000ULL-MP_FLASH_SIZE_MAX, NULL,
                               "musicpal.flash", flash_size,
                               dinfo->bdrv, 0x10000,
                               (flash_size + 0xffff) >> 16,