Re: [U-Boot] [PATCH v2 2/6] sunxi: add Kconfig option for the maximum accessible DRAM

2018-03-23 Thread Icenowy Zheng


于 2018年3月23日 GMT+08:00 下午5:39:25, Maxime Ripard  写到:
>On Fri, Mar 23, 2018 at 04:18:53PM +0800, Icenowy Zheng wrote:
>> Allwinner 64-bit SoCs can use 4GiB DRAM chip, however their memory
>map
>> has only allocated 3GiB for DRAM, so only 3GiB of the DRAM is
>> accessible.
>
>How would that work in Linux?

From CPU's view only 3GiB DRAM is attached, so Linux can
use the 3GiB space only.

Only the DRAM controller knows that 4GiB DRAM is connected :-)

>
>> Add a Kconfig option for the maximum accessible DRAM.
>> 
>> For A80 it should be a much higher value (8GiB), but as I have no A80
>> device to test and originally U-Boot only supports 2GiB DRAM on A80,
>it
>> currently still falls under the 2GiB situation.
>
>I guess we have LPAE on armv7 to deal with this nicely.
>
>Maxime
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/6] sunxi: add Kconfig option for the maximum accessible DRAM

2018-03-23 Thread Chen-Yu Tsai
On Fri, Mar 23, 2018 at 5:39 PM, Maxime Ripard
 wrote:
> On Fri, Mar 23, 2018 at 04:18:53PM +0800, Icenowy Zheng wrote:
>> Allwinner 64-bit SoCs can use 4GiB DRAM chip, however their memory map
>> has only allocated 3GiB for DRAM, so only 3GiB of the DRAM is
>> accessible.
>
> How would that work in Linux?
>
>> Add a Kconfig option for the maximum accessible DRAM.
>>
>> For A80 it should be a much higher value (8GiB), but as I have no A80
>> device to test and originally U-Boot only supports 2GiB DRAM on A80, it
>> currently still falls under the 2GiB situation.
>
> I guess we have LPAE on armv7 to deal with this nicely.

AFAIK even though we do have LPAE, the hardware bus is not wired up
to take advantage of it. :(

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


Re: [U-Boot] [PATCH v2 2/6] sunxi: add Kconfig option for the maximum accessible DRAM

2018-03-23 Thread Maxime Ripard
On Fri, Mar 23, 2018 at 04:18:53PM +0800, Icenowy Zheng wrote:
> Allwinner 64-bit SoCs can use 4GiB DRAM chip, however their memory map
> has only allocated 3GiB for DRAM, so only 3GiB of the DRAM is
> accessible.

How would that work in Linux?

> Add a Kconfig option for the maximum accessible DRAM.
> 
> For A80 it should be a much higher value (8GiB), but as I have no A80
> device to test and originally U-Boot only supports 2GiB DRAM on A80, it
> currently still falls under the 2GiB situation.

I guess we have LPAE on armv7 to deal with this nicely.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/6] sunxi: add Kconfig option for the maximum accessible DRAM

2018-03-23 Thread Icenowy Zheng
Allwinner 64-bit SoCs can use 4GiB DRAM chip, however their memory map
has only allocated 3GiB for DRAM, so only 3GiB of the DRAM is
accessible.

Add a Kconfig option for the maximum accessible DRAM.

For A80 it should be a much higher value (8GiB), but as I have no A80
device to test and originally U-Boot only supports 2GiB DRAM on A80, it
currently still falls under the 2GiB situation.

Signed-off-by: Icenowy Zheng 
---
No changes in v2.

 arch/arm/mach-sunxi/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b868f0e350..029821c82d 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -130,6 +130,13 @@ config MACH_SUNXI_H3_H5
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
 
+# TODO: try out A80's 8GiB DRAM space
+config SUNXI_DRAM_MAX_SIZE
+   hex
+   default 0xC000 if MACH_SUN50I
+   default 0xC000 if MACH_SUN50I_H5
+   default 0x8000
+
 choice
prompt "Sunxi SoC Variant"
optional
-- 
2.15.1

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