170-cisco-hack.patch 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. From patchwork Wed Jun 8 13:49:26 2016
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 8bit
  5. Subject: [LEDE-DEV] cavium: Ignore MEM boot param when too small
  6. From: =?utf-8?q?Micha=C5=82_Osowiecki?= <michal.osowiecki@gmail.com>
  7. X-Patchwork-Id: 632273
  8. Message-Id: <57582266.8020105@gmail.com>
  9. To: lede-dev@lists.infradead.org
  10. Date: Wed, 8 Jun 2016 15:49:26 +0200
  11. Cisco RV0XX u-boot sets MEM=2048 as boot param. We assume that at least
  12. 4MB (mem_alloc_size) of ram is needed to run linux on cavium boards, so
  13. if mem < 4M - ignore it and set default value
  14. Signed-off-by: Michał Osowiecki <michal.osowiecki@gmail.com>
  15. --- a/arch/mips/cavium-octeon/setup.c
  16. +++ b/arch/mips/cavium-octeon/setup.c
  17. @@ -944,6 +944,10 @@ void __init plat_mem_setup(void)
  18. if (mem_alloc_size > MAX_MEMORY)
  19. mem_alloc_size = MAX_MEMORY;
  20. + /* Ignore bootarg MEM <= 4MB - cisco uses a b0rked uboot env on their products */
  21. + if (MAX_MEMORY <= mem_alloc_size)
  22. + MAX_MEMORY = 512ull << 20;
  23. +
  24. /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */
  25. #ifdef CONFIG_CRASH_DUMP
  26. add_memory_region(RESERVE_LOW_MEM, MAX_MEMORY, BOOT_MEM_RAM);