All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon
@ 2017-02-21  5:12 Joel Stanley
  2017-02-21  5:12 ` [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines Joel Stanley
  2017-02-21  7:00 ` [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Mine
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Stanley @ 2017-02-21  5:12 UTC (permalink / raw)
  To: openbmc; +Cc: Cyril Bur, Lei YU, Xo Wang

They both contain 512M of RAM. Early bringup Witherspoons did have 1G,
but all machines we are using now have 512M.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 2 +-
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 85e545110be6..58baf87454e2 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -17,7 +17,7 @@
 	};
 
 	memory {
-		reg = <0x80000000 0x40000000>;
+		reg = <0x80000000 0x20000000>;
 	};
 
 	fsi-master {
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
index 4b2d8aa8abb6..2cbdeba88908 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
@@ -17,7 +17,7 @@
 	};
 
 	memory {
-		reg = <0x80000000 0x40000000>;
+		reg = <0x80000000 0x20000000>;
 	};
 
 	reserved-memory {
-- 
2.11.0

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

* [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-21  5:12 [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Joel Stanley
@ 2017-02-21  5:12 ` Joel Stanley
  2017-02-22  2:25   ` Suraj Jitindar Singh
  2017-02-23  3:34   ` Mine
  2017-02-21  7:00 ` [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Mine
  1 sibling, 2 replies; 9+ messages in thread
From: Joel Stanley @ 2017-02-21  5:12 UTC (permalink / raw)
  To: openbmc; +Cc: Cyril Bur, Lei YU, Xo Wang

This flash_memory region reserved memory region is used by the host<->bmc
mailbox daemon.

The vga_memory region is for the host processor's framebuffer when using
the Aspeed as a PCI graphics device. We reserve the maximum region to
protect against bad host drivers. In the future this should correspond
to the amount of memory we've told the host it can use.

These numbers were generated as follows for Zaius:

 $ genmem.py --ram-base 0x80000000 --ram 1G --flash 64M

And for Romulus and Witherspoon:

 $ genmem.py --ram-base 0x80000000 --ram 512M --flash 64M --vga 64M

With this script:

def convert_one(s):
    suffixes = [
                ('K', 1024),
                ('M', (1024*1024)),
                ('G', (1024*1024*1024)),
                ('T', (1024*1024*1024*1024)),
                ('th', 1000),
                ('mi', (1000*1000)),
                ('bi', (1000*1000*1000)),
                ('tri', (1000*1000*1000*1000))
               ]

    s = s.strip()

    factor = 1
    for suffix, mul in suffixes:
        if s.endswith(suffix) or s.endswith(suffix.lower()):
            factor = mul
            s = s[:-len(suffix)]
            break

    val = None

    if s.startswith('0b'):
        val = convert_binary(s)
    elif s.startswith('0x'):
        val = int(s, 16)
    else:
        for c in 'abcdefABCDEF':
            if c in s:
                val = int(s, 16)
                break

    if val is None:
        val = int(s)

    val *= factor

    return val

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--ram-base')
parser.add_argument('--ram')
parser.add_argument('--flash')
parser.add_argument('--vga')

args = parser.parse_args()
base = convert_one(args.ram_base)
size = convert_one(args.ram)
flash_size = convert_one(args.flash)
vga_size = 0
if args.vga:
    vga_size = convert_one(args.vga)

vga_base = base + size - vga_size
flash_base = base + size - vga_size - flash_size

if flash_base % flash_size != 0:
    print("Error: flash base address not a multiple of window. Rounding down")
    flash_base -= flash_base % flash_size

print("memory {\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (base, size))
if vga_size > 0:
    print("vga_memory {\r\n\tno-map;\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (vga_base, vga_base))
print("flash_memory {\r\n\tno-map;\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (flash_base, flash_size))

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 16 ++++++++++++++++
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts |  9 +++++++--
 arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts       |  4 ++--
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
index 58baf87454e2..7293b41239a3 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
@@ -20,6 +20,22 @@
 		reg = <0x80000000 0x20000000>;
 	};
 
+	reserved-memory {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		vga_memory: region@9c000000 {
+			no-map;
+			reg = <0x9c000000 0x04000000>; /* 64M */
+		};
+
+		flash_memory: region@98000000 {
+			no-map;
+			reg = <0x98000000 0x04000000>; /* 64M */
+		};
+	};
+
 	fsi-master {
 		compatible = "ibm,fsi-master", "ibm,fsi-master-gpio";
 
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
index 2cbdeba88908..1ea8f65c1dab 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
@@ -25,9 +25,14 @@
 		#size-cells = <1>;
 		ranges;
 
-		flash_memory: region@94000000 {
+		vga_memory: region@9c000000 {
 			no-map;
-			reg = <0x94000000 0x04000000>; /* 64M */
+			reg = <0x9c000000 0x04000000>; /* 64M */
+		};
+
+		flash_memory: region@98000000 {
+			no-map;
+			reg = <0x98000000 0x04000000>; /* 64M */
 		};
 	};
 
diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
index e1c9b3f4fe44..c3a6a8656b3e 100644
--- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
+++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
@@ -25,9 +25,9 @@
 		#size-cells = <1>;
 		ranges;
 
-		flash_memory: region@94000000 {
+		flash_memory: region@bc000000 {
 			no-map;
-			reg = <0x94000000 0x04000000>; /* 64M */
+			reg = <0xbc000000 0x04000000>; /* 64M */
 		};
 	};
 
-- 
2.11.0

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

* Re: [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon
  2017-02-21  5:12 [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Joel Stanley
  2017-02-21  5:12 ` [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines Joel Stanley
@ 2017-02-21  7:00 ` Mine
  2017-02-22 13:55   ` Joel Stanley
  1 sibling, 1 reply; 9+ messages in thread
From: Mine @ 2017-02-21  7:00 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist, Cyril Bur, Xo Wang

Acked-by: Lei YU <mine260309@gmail.com>

I think Zaius uses 512MiB RAM as well.
Xo Wang could you help to confirm?

On Tue, Feb 21, 2017 at 1:12 PM, Joel Stanley <joel@jms.id.au> wrote:
> They both contain 512M of RAM. Early bringup Witherspoons did have 1G,
> but all machines we are using now have 512M.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 2 +-
>  arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> index 85e545110be6..58baf87454e2 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> @@ -17,7 +17,7 @@
>         };
>
>         memory {
> -               reg = <0x80000000 0x40000000>;
> +               reg = <0x80000000 0x20000000>;
>         };
>
>         fsi-master {
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> index 4b2d8aa8abb6..2cbdeba88908 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> @@ -17,7 +17,7 @@
>         };
>
>         memory {
> -               reg = <0x80000000 0x40000000>;
> +               reg = <0x80000000 0x20000000>;
>         };
>
>         reserved-memory {
> --
> 2.11.0
>

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

* Re: [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-21  5:12 ` [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines Joel Stanley
@ 2017-02-22  2:25   ` Suraj Jitindar Singh
  2017-02-23  3:34   ` Mine
  1 sibling, 0 replies; 9+ messages in thread
From: Suraj Jitindar Singh @ 2017-02-22  2:25 UTC (permalink / raw)
  To: Joel Stanley, openbmc; +Cc: Cyril Bur

On Tue, 2017-02-21 at 15:42 +1030, Joel Stanley wrote:
> This flash_memory region reserved memory region is used by the host<-
> >bmc
> mailbox daemon.
> 
> The vga_memory region is for the host processor's framebuffer when
> using
> the Aspeed as a PCI graphics device. We reserve the maximum region to
> protect against bad host drivers. In the future this should
> correspond
> to the amount of memory we've told the host it can use.
> 
> These numbers were generated as follows for Zaius:
> 
>  $ genmem.py --ram-base 0x80000000 --ram 1G --flash 64M
> 
> And for Romulus and Witherspoon:
> 
>  $ genmem.py --ram-base 0x80000000 --ram 512M --flash 64M --vga 64M
> 
> With this script:
> 
> def convert_one(s):
>     suffixes = [
>                 ('K', 1024),
>                 ('M', (1024*1024)),
>                 ('G', (1024*1024*1024)),
>                 ('T', (1024*1024*1024*1024)),
>                 ('th', 1000),
>                 ('mi', (1000*1000)),
>                 ('bi', (1000*1000*1000)),
>                 ('tri', (1000*1000*1000*1000))
>                ]
> 
>     s = s.strip()
> 
>     factor = 1
>     for suffix, mul in suffixes:
>         if s.endswith(suffix) or s.endswith(suffix.lower()):
>             factor = mul
>             s = s[:-len(suffix)]
>             break
> 
>     val = None
> 
>     if s.startswith('0b'):
>         val = convert_binary(s)
>     elif s.startswith('0x'):
>         val = int(s, 16)
>     else:
>         for c in 'abcdefABCDEF':
>             if c in s:
>                 val = int(s, 16)
>                 break
> 
>     if val is None:
>         val = int(s)
> 
>     val *= factor
> 
>     return val
> 
> import argparse
> parser = argparse.ArgumentParser()
> parser.add_argument('--ram-base')
> parser.add_argument('--ram')
> parser.add_argument('--flash')
> parser.add_argument('--vga')
> 
> args = parser.parse_args()
> base = convert_one(args.ram_base)
> size = convert_one(args.ram)
> flash_size = convert_one(args.flash)
> vga_size = 0
> if args.vga:
>     vga_size = convert_one(args.vga)
> 
> vga_base = base + size - vga_size
> flash_base = base + size - vga_size - flash_size
> 
> if flash_base % flash_size != 0:
>     print("Error: flash base address not a multiple of window.
> Rounding down")
>     flash_base -= flash_base % flash_size
> 
> print("memory {\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (base, size))
> if vga_size > 0:
>     print("vga_memory {\r\n\tno-map;\r\n\treg = <0x%08x
> 0x%08x>;\r\n}" % (vga_base, vga_base))
> print("flash_memory {\r\n\tno-map;\r\n\treg = <0x%08x 0x%08x>;\r\n}"
> % (flash_base, flash_size))
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 16
> ++++++++++++++++
>  arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts |  9 +++++++--
>  arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts       |  4 ++--
>  3 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> index 58baf87454e2..7293b41239a3 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> @@ -20,6 +20,22 @@
>  		reg = <0x80000000 0x20000000>;
>  	};
>  
> +	reserved-memory {
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		ranges;
> +
> +		vga_memory: region@9c000000 {
> +			no-map;
> +			reg = <0x9c000000 0x04000000>; /* 64M */
> +		};
> +
> +		flash_memory: region@98000000 {
> +			no-map;
> +			reg = <0x98000000 0x04000000>; /* 64M */
> +		};
> +	};
> +
>  	fsi-master {
>  		compatible = "ibm,fsi-master", "ibm,fsi-master-
> gpio";
>  
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> index 2cbdeba88908..1ea8f65c1dab 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> @@ -25,9 +25,14 @@
>  		#size-cells = <1>;
>  		ranges;
>  
> -		flash_memory: region@94000000 {
> +		vga_memory: region@9c000000 {
>  			no-map;
> -			reg = <0x94000000 0x04000000>; /* 64M */
> +			reg = <0x9c000000 0x04000000>; /* 64M */
> +		};
> +
> +		flash_memory: region@98000000 {
> +			no-map;
> +			reg = <0x98000000 0x04000000>; /* 64M */
>  		};
>  	};
>  
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> index e1c9b3f4fe44..c3a6a8656b3e 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> @@ -25,9 +25,9 @@
>  		#size-cells = <1>;
>  		ranges;
>  
> -		flash_memory: region@94000000 {
> +		flash_memory: region@bc000000 {
>  			no-map;
> -			reg = <0x94000000 0x04000000>; /* 64M */
> +			reg = <0xbc000000 0x04000000>; /* 64M */
>  		};
>  	};
>  
FWIW:

Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>

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

* Re: [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon
  2017-02-21  7:00 ` [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Mine
@ 2017-02-22 13:55   ` Joel Stanley
  0 siblings, 0 replies; 9+ messages in thread
From: Joel Stanley @ 2017-02-22 13:55 UTC (permalink / raw)
  To: Mine; +Cc: OpenBMC Maillist, Cyril Bur, Xo Wang

On Tue, Feb 21, 2017 at 5:30 PM, Mine <mine260309@gmail.com> wrote:
> Acked-by: Lei YU <mine260309@gmail.com>

Thanks for the ack Lei. Applied to dev-4.7.

> I think Zaius uses 512MiB RAM as well.
> Xo Wang could you help to confirm?

Zaius currently has 1GB. It may drop down to 512MB with future
revisions, but we will handle that from u-boot.

As it currently stands u-boot is updating the device tree for us so
the number we're putting in here is only used when eg. booting from
Qemu without u-boot.

Cheers,

Joel

>
> On Tue, Feb 21, 2017 at 1:12 PM, Joel Stanley <joel@jms.id.au> wrote:
>> They both contain 512M of RAM. Early bringup Witherspoons did have 1G,
>> but all machines we are using now have 512M.
>>
>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>> ---
>>  arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 2 +-
>>  arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
>> index 85e545110be6..58baf87454e2 100644
>> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
>> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
>> @@ -17,7 +17,7 @@
>>         };
>>
>>         memory {
>> -               reg = <0x80000000 0x40000000>;
>> +               reg = <0x80000000 0x20000000>;
>>         };
>>
>>         fsi-master {
>> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
>> index 4b2d8aa8abb6..2cbdeba88908 100644
>> --- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
>> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
>> @@ -17,7 +17,7 @@
>>         };
>>
>>         memory {
>> -               reg = <0x80000000 0x40000000>;
>> +               reg = <0x80000000 0x20000000>;
>>         };
>>
>>         reserved-memory {
>> --
>> 2.11.0
>>

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

* Re: [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-21  5:12 ` [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines Joel Stanley
  2017-02-22  2:25   ` Suraj Jitindar Singh
@ 2017-02-23  3:34   ` Mine
  2017-02-23  4:00     ` Joel Stanley
  2017-02-23 18:36     ` Xo Wang
  1 sibling, 2 replies; 9+ messages in thread
From: Mine @ 2017-02-23  3:34 UTC (permalink / raw)
  To: Joel Stanley; +Cc: OpenBMC Maillist, Cyril Bur, Xo Wang

Hi Joel,

On Tue, Feb 21, 2017 at 1:12 PM, Joel Stanley <joel@jms.id.au> wrote:
> This flash_memory region reserved memory region is used by the host<->bmc
> mailbox daemon.
>
> The vga_memory region is for the host processor's framebuffer when using
> the Aspeed as a PCI graphics device. We reserve the maximum region to
> protect against bad host drivers. In the future this should correspond
> to the amount of memory we've told the host it can use.
>
> These numbers were generated as follows for Zaius:
>
>  $ genmem.py --ram-base 0x80000000 --ram 1G --flash 64M
>
> And for Romulus and Witherspoon:
>
>  $ genmem.py --ram-base 0x80000000 --ram 512M --flash 64M --vga 64M
>
> With this script:
>
> def convert_one(s):
>     suffixes = [
>                 ('K', 1024),
>                 ('M', (1024*1024)),
>                 ('G', (1024*1024*1024)),
>                 ('T', (1024*1024*1024*1024)),
>                 ('th', 1000),
>                 ('mi', (1000*1000)),
>                 ('bi', (1000*1000*1000)),
>                 ('tri', (1000*1000*1000*1000))
>                ]
>
>     s = s.strip()
>
>     factor = 1
>     for suffix, mul in suffixes:
>         if s.endswith(suffix) or s.endswith(suffix.lower()):
>             factor = mul
>             s = s[:-len(suffix)]
>             break
>
>     val = None
>
>     if s.startswith('0b'):
>         val = convert_binary(s)
>     elif s.startswith('0x'):
>         val = int(s, 16)
>     else:
>         for c in 'abcdefABCDEF':
>             if c in s:
>                 val = int(s, 16)
>                 break
>
>     if val is None:
>         val = int(s)
>
>     val *= factor
>
>     return val
>
> import argparse
> parser = argparse.ArgumentParser()
> parser.add_argument('--ram-base')
> parser.add_argument('--ram')
> parser.add_argument('--flash')
> parser.add_argument('--vga')
>
> args = parser.parse_args()
> base = convert_one(args.ram_base)
> size = convert_one(args.ram)
> flash_size = convert_one(args.flash)
> vga_size = 0
> if args.vga:
>     vga_size = convert_one(args.vga)
>
> vga_base = base + size - vga_size
> flash_base = base + size - vga_size - flash_size
>
> if flash_base % flash_size != 0:
>     print("Error: flash base address not a multiple of window. Rounding down")
>     flash_base -= flash_base % flash_size
>
> print("memory {\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (base, size))
> if vga_size > 0:
>     print("vga_memory {\r\n\tno-map;\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (vga_base, vga_base))
> print("flash_memory {\r\n\tno-map;\r\n\treg = <0x%08x 0x%08x>;\r\n}" % (flash_base, flash_size))
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts     | 16 ++++++++++++++++
>  arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts |  9 +++++++--
>  arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts       |  4 ++--
>  3 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> index 58baf87454e2..7293b41239a3 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
> @@ -20,6 +20,22 @@
>                 reg = <0x80000000 0x20000000>;
>         };
>
> +       reserved-memory {
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               ranges;
> +
> +               vga_memory: region@9c000000 {
> +                       no-map;
> +                       reg = <0x9c000000 0x04000000>; /* 64M */
> +               };
> +
> +               flash_memory: region@98000000 {
> +                       no-map;
> +                       reg = <0x98000000 0x04000000>; /* 64M */
> +               };
> +       };
> +
>         fsi-master {
>                 compatible = "ibm,fsi-master", "ibm,fsi-master-gpio";
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> index 2cbdeba88908..1ea8f65c1dab 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
> @@ -25,9 +25,14 @@
>                 #size-cells = <1>;
>                 ranges;
>
> -               flash_memory: region@94000000 {
> +               vga_memory: region@9c000000 {
>                         no-map;
> -                       reg = <0x94000000 0x04000000>; /* 64M */
> +                       reg = <0x9c000000 0x04000000>; /* 64M */
> +               };
> +
> +               flash_memory: region@98000000 {
> +                       no-map;
> +                       reg = <0x98000000 0x04000000>; /* 64M */
>                 };
>         };
>
> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> index e1c9b3f4fe44..c3a6a8656b3e 100644
> --- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
> @@ -25,9 +25,9 @@
>                 #size-cells = <1>;
>                 ranges;
>
> -               flash_memory: region@94000000 {
> +               flash_memory: region@bc000000 {
>                         no-map;
> -                       reg = <0x94000000 0x04000000>; /* 64M */
> +                       reg = <0xbc000000 0x04000000>; /* 64M */

For Zaius with 512MiB RAM (what I saw in Foxconn), the memory size
will be adjusted by Uboot,
which is OK.
Will this reserved memory be adjusted from 0xbc000000 to 0x9c000000?

>                 };
>         };
>
> --
> 2.11.0
>

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

* Re: [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-23  3:34   ` Mine
@ 2017-02-23  4:00     ` Joel Stanley
  2017-02-23 18:36     ` Xo Wang
  1 sibling, 0 replies; 9+ messages in thread
From: Joel Stanley @ 2017-02-23  4:00 UTC (permalink / raw)
  To: Mine, Benjamin Herrenschmidt; +Cc: OpenBMC Maillist, Cyril Bur, Xo Wang

On Thu, Feb 23, 2017 at 2:04 PM, Mine <mine260309@gmail.com> wrote:
>> -               flash_memory: region@94000000 {
>> +               flash_memory: region@bc000000 {
>>                         no-map;
>> -                       reg = <0x94000000 0x04000000>; /* 64M */
>> +                       reg = <0xbc000000 0x04000000>; /* 64M */
>
> For Zaius with 512MiB RAM (what I saw in Foxconn), the memory size
> will be adjusted by Uboot,
> which is OK.
> Will this reserved memory be adjusted from 0xbc000000 to 0x9c000000?

You raise an issue I have been thinking about.

u-boot currently adjusts the /memory node to account for the VGA
framebuffer. We could instead have it populate a reserved-memory
region.

A compromise (for cases where the u-boot hasn't been updated, or the
user is testing in Qemu without u-boot) would be to have the node in
the device tree set to a default value and get u-boot to update it to
the same as the strapping.

Cheers,

Joel

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

* Re: [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-23  3:34   ` Mine
  2017-02-23  4:00     ` Joel Stanley
@ 2017-02-23 18:36     ` Xo Wang
  2017-02-25  5:52       ` Lei YU
  1 sibling, 1 reply; 9+ messages in thread
From: Xo Wang @ 2017-02-23 18:36 UTC (permalink / raw)
  To: Mine; +Cc: Joel Stanley, OpenBMC Maillist, Cyril Bur

Hi Mine,

On Wed, Feb 22, 2017 at 7:34 PM, Mine <mine260309@gmail.com> wrote:
>> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>> index e1c9b3f4fe44..c3a6a8656b3e 100644
>> --- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>> @@ -25,9 +25,9 @@
>>                 #size-cells = <1>;
>>                 ranges;
>>
>> -               flash_memory: region@94000000 {
>> +               flash_memory: region@bc000000 {
>>                         no-map;
>> -                       reg = <0x94000000 0x04000000>; /* 64M */
>> +                       reg = <0xbc000000 0x04000000>; /* 64M */
>
> For Zaius with 512MiB RAM (what I saw in Foxconn), the memory size
> will be adjusted by Uboot,
> which is OK.
> Will this reserved memory be adjusted from 0xbc000000 to 0x9c000000?

We have no plans to use RAM size other than 1 GiB for Zaius BMC. Can
you please explain what you saw at Foxconn?

thanks
xo

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

* Re: [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines
  2017-02-23 18:36     ` Xo Wang
@ 2017-02-25  5:52       ` Lei YU
  0 siblings, 0 replies; 9+ messages in thread
From: Lei YU @ 2017-02-25  5:52 UTC (permalink / raw)
  To: Xo Wang; +Cc: Joel Stanley, OpenBMC Maillist, Cyril Bur

Hi Xo,

I got confirmation that Zaius does use 1GiB RAM.
Please ignore my previous comment.

--
BRs,
Lei YU

On Fri, Feb 24, 2017 at 2:36 AM, Xo Wang <xow@google.com> wrote:
> Hi Mine,
>
> On Wed, Feb 22, 2017 at 7:34 PM, Mine <mine260309@gmail.com> wrote:
>>> diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>>> index e1c9b3f4fe44..c3a6a8656b3e 100644
>>> --- a/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>>> +++ b/arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
>>> @@ -25,9 +25,9 @@
>>>                 #size-cells = <1>;
>>>                 ranges;
>>>
>>> -               flash_memory: region@94000000 {
>>> +               flash_memory: region@bc000000 {
>>>                         no-map;
>>> -                       reg = <0x94000000 0x04000000>; /* 64M */
>>> +                       reg = <0xbc000000 0x04000000>; /* 64M */
>>
>> For Zaius with 512MiB RAM (what I saw in Foxconn), the memory size
>> will be adjusted by Uboot,
>> which is OK.
>> Will this reserved memory be adjusted from 0xbc000000 to 0x9c000000?
>
> We have no plans to use RAM size other than 1 GiB for Zaius BMC. Can
> you please explain what you saw at Foxconn?
>
> thanks
> xo

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

end of thread, other threads:[~2017-02-25  5:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21  5:12 [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Joel Stanley
2017-02-21  5:12 ` [PATCH linux dev-4.7 2/2] ARM: dts: aspeed: Reserve memory on all P9 machines Joel Stanley
2017-02-22  2:25   ` Suraj Jitindar Singh
2017-02-23  3:34   ` Mine
2017-02-23  4:00     ` Joel Stanley
2017-02-23 18:36     ` Xo Wang
2017-02-25  5:52       ` Lei YU
2017-02-21  7:00 ` [PATCH linux dev-4.7 1/2] ARM: dts: aspeed: Fix RAM size in Romulus and Witherspoon Mine
2017-02-22 13:55   ` Joel Stanley

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.