xref: /OK3568_Linux_fs/kernel/arch/mips/ath79/prom.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  *  Atheros AR71XX/AR724X/AR913X specific prom routines
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  *  Copyright (C) 2015 Laurent Fasnacht <l@libres.ch>
6*4882a593Smuzhiyun  *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
7*4882a593Smuzhiyun  *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <linux/kernel.h>
11*4882a593Smuzhiyun #include <linux/init.h>
12*4882a593Smuzhiyun #include <linux/io.h>
13*4882a593Smuzhiyun #include <linux/string.h>
14*4882a593Smuzhiyun #include <linux/initrd.h>
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #include <asm/bootinfo.h>
17*4882a593Smuzhiyun #include <asm/addrspace.h>
18*4882a593Smuzhiyun #include <asm/fw/fw.h>
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun #include "common.h"
21*4882a593Smuzhiyun 
prom_init(void)22*4882a593Smuzhiyun void __init prom_init(void)
23*4882a593Smuzhiyun {
24*4882a593Smuzhiyun 	fw_init_cmdline();
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #ifdef CONFIG_BLK_DEV_INITRD
27*4882a593Smuzhiyun 	/* Read the initrd address from the firmware environment */
28*4882a593Smuzhiyun 	initrd_start = fw_getenvl("initrd_start");
29*4882a593Smuzhiyun 	if (initrd_start) {
30*4882a593Smuzhiyun 		initrd_start = KSEG0ADDR(initrd_start);
31*4882a593Smuzhiyun 		initrd_end = initrd_start + fw_getenvl("initrd_size");
32*4882a593Smuzhiyun 	}
33*4882a593Smuzhiyun #endif
34*4882a593Smuzhiyun }
35*4882a593Smuzhiyun 
prom_free_prom_memory(void)36*4882a593Smuzhiyun void __init prom_free_prom_memory(void)
37*4882a593Smuzhiyun {
38*4882a593Smuzhiyun 	/* We do not have to prom memory to free */
39*4882a593Smuzhiyun }
40