mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 17:45:09 +07:00
fd534e9b5f
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 50 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190523091649.499889647@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org>
|
|
* Copyright (C) 2007 Eugene Konev <ejka@openwrt.org>
|
|
*/
|
|
#include <linux/memblock.h>
|
|
#include <linux/init.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/pfn.h>
|
|
#include <linux/proc_fs.h>
|
|
#include <linux/string.h>
|
|
#include <linux/swap.h>
|
|
|
|
#include <asm/bootinfo.h>
|
|
#include <asm/page.h>
|
|
#include <asm/sections.h>
|
|
|
|
#include <asm/mach-ar7/ar7.h>
|
|
|
|
static int __init memsize(void)
|
|
{
|
|
u32 size = (64 << 20);
|
|
u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4);
|
|
u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end));
|
|
u32 *tmpaddr = addr;
|
|
|
|
while (tmpaddr > kernel_end) {
|
|
*tmpaddr = (u32)tmpaddr;
|
|
size >>= 1;
|
|
tmpaddr -= size >> 2;
|
|
}
|
|
|
|
do {
|
|
tmpaddr += size >> 2;
|
|
if (*tmpaddr != (u32)tmpaddr)
|
|
break;
|
|
size <<= 1;
|
|
} while (size < (64 << 20));
|
|
|
|
writel((u32)tmpaddr, &addr);
|
|
|
|
return size;
|
|
}
|
|
|
|
void __init prom_meminit(void)
|
|
{
|
|
unsigned long pages;
|
|
|
|
pages = memsize() >> PAGE_SHIFT;
|
|
add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, BOOT_MEM_RAM);
|
|
}
|
|
|
|
void __init prom_free_prom_memory(void)
|
|
{
|
|
/* Nothing to free */
|
|
}
|