diff options
author | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2020-10-06 15:58:37 +0200 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2020-10-08 10:32:51 +0200 |
commit | 43fab0856eafb32d5cdb809d8225197755826128 (patch) | |
tree | b263484766486d8d3940ac67c82d13bc3c3266e1 /arch/mips/txx9/rbtx4939/prom.c | |
parent | 9b7224836965550649357732f7f0b63a5bfcc305 (diff) |
MIPS: tx49xx: move tx4939_add_memory_regions into only user
tx4939_add_memory_regions() is only used in txx9/rbtx4939/prom.c.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/txx9/rbtx4939/prom.c')
-rw-r--r-- | arch/mips/txx9/rbtx4939/prom.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/mips/txx9/rbtx4939/prom.c b/arch/mips/txx9/rbtx4939/prom.c index bd277ecb4ad6..1dc47ce81c92 100644 --- a/arch/mips/txx9/rbtx4939/prom.c +++ b/arch/mips/txx9/rbtx4939/prom.c @@ -7,11 +7,23 @@ */ #include <linux/init.h> +#include <asm/bootinfo.h> #include <asm/txx9/generic.h> #include <asm/txx9/rbtx4939.h> void __init rbtx4939_prom_init(void) { - tx4939_add_memory_regions(); + unsigned long start, size; + u64 win; + int i; + + for (i = 0; i < 4; i++) { + if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i))) + continue; + win = ____raw_readq(&tx4939_ddrcptr->win[i]); + start = (unsigned long)(win >> 48); + size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start; + add_memory_region(start << 20, size << 20, BOOT_MEM_RAM); + } txx9_sio_putchar_init(TX4939_SIO_REG(0) & 0xfffffffffULL); } |