Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758254AbbEVP4F (ORCPT ); Fri, 22 May 2015 11:56:05 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:45001 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757129AbbEVP4A (ORCPT ); Fri, 22 May 2015 11:56:00 -0400 From: Paul Burton To: CC: , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "Paul Burton" , Ralf Baechle , Subject: [PATCH 15/15] MIPS: malta: setup post-I/O hole RAM on non-EVA Date: Fri, 22 May 2015 16:51:14 +0100 Message-ID: <1432309875-9712-16-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432309875-9712-1-git-send-email-paul.burton@imgtec.com> References: <1432309875-9712-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.159.131] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1752 Lines: 47 If the system has more than 256MB RAM (ie. more than will fit in the unmapped kseg[01] regions before the I/O hole) then set up a region to use that memory via its alias in the upper half of the physical address space, where the I/O hole is not present. This allows highmem to be used on Malta without needing to manually specify mem= parameters on the kernel command line. Signed-off-by: Paul Burton --- arch/mips/mti-malta/malta-dtshim.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/mips/mti-malta/malta-dtshim.c b/arch/mips/mti-malta/malta-dtshim.c index 9074951..6320b44 100644 --- a/arch/mips/mti-malta/malta-dtshim.c +++ b/arch/mips/mti-malta/malta-dtshim.c @@ -23,7 +23,7 @@ static unsigned char fdt_buf[16 << 10] __initdata; /* determined physical memory size, not overridden by command line args */ extern unsigned long physical_memsize; -#define MAX_MEM_ARRAY_ENTRIES 1 +#define MAX_MEM_ARRAY_ENTRIES 2 static unsigned __init gen_fdt_mem_array(__be32 *mem_array, unsigned long size) { @@ -37,6 +37,12 @@ static unsigned __init gen_fdt_mem_array(__be32 *mem_array, unsigned long size) } else { size_preio = min_t(unsigned long, size, 256 << 20); mem_array[1] = cpu_to_be32(PHYS_OFFSET + size_preio); + + if (size > size_preio) { + entries++; + mem_array[2] = cpu_to_be32(0x80000000 + size_preio); + mem_array[3] = cpu_to_be32(size - size_preio); + } } BUG_ON(entries > MAX_MEM_ARRAY_ENTRIES); -- 2.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/