From bfb33f0bc45b9ee92ed2f85107cf20b9bfdf9f8a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 14 Apr 2016 18:53:32 +0200 Subject: [PATCH 1/2] sunxi: mctl_mem_matches: Add missing memory barrier We are running with the caches disabled when mctl_mem_matches gets called, but the cpu's write buffer is still there and can still get in the way, add a memory barrier to fix this. This avoids mctl_mem_matches always returning false in some cases, which was resulting in: U-Boot SPL 2015.07 (Apr 14 2016 - 18:47:26) DRAM: 1024 MiB U-Boot 2015.07 (Apr 14 2016 - 18:47:26 +0200) Allwinner Technology CPU: Allwinner A23 (SUN8I) DRAM: 512 MiB Where 512 MiB is the right amount, but the DRAM controller would be initialized for 1024 MiB. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- arch/arm/mach-sunxi/dram_helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sunxi/dram_helpers.c b/arch/arm/mach-sunxi/dram_helpers.c index 50318d2eb6..e0c823a4dd 100644 --- a/arch/arm/mach-sunxi/dram_helpers.c +++ b/arch/arm/mach-sunxi/dram_helpers.c @@ -7,6 +7,7 @@ */ #include +#include #include #include @@ -31,6 +32,7 @@ bool mctl_mem_matches(u32 offset) /* Try to write different values to RAM at two addresses */ writel(0, CONFIG_SYS_SDRAM_BASE); writel(0xaa55aa55, (ulong)CONFIG_SYS_SDRAM_BASE + offset); + DSB; /* Check if the same value is actually observed when reading back */ return readl(CONFIG_SYS_SDRAM_BASE) == readl((ulong)CONFIG_SYS_SDRAM_BASE + offset); From ad14166426ab8ca40424ede741d27fdcfb4fc2c6 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 14 Apr 2016 16:49:47 +0200 Subject: [PATCH 2/2] sunxi: Enable LDO3 at 3.3V on A13-OLinuXino board LDO3 is used for the VGA output, this fixes a regression where the VGA output on these boards would no longer work. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- configs/A13-OLinuXino_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/A13-OLinuXino_defconfig b/configs/A13-OLinuXino_defconfig index d2d0cbda6d..30ea836f39 100644 --- a/configs/A13-OLinuXino_defconfig +++ b/configs/A13-OLinuXino_defconfig @@ -32,6 +32,7 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_AXP_ALDO3_VOLT=3300 CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_USB_GADGET=y