18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Atheros AR71XX/AR724X/AR913X specific prom routines
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2015 Laurent Fasnacht <l@libres.ch>
68c2ecf20Sopenharmony_ci *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
78c2ecf20Sopenharmony_ci *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/kernel.h>
118c2ecf20Sopenharmony_ci#include <linux/init.h>
128c2ecf20Sopenharmony_ci#include <linux/io.h>
138c2ecf20Sopenharmony_ci#include <linux/string.h>
148c2ecf20Sopenharmony_ci#include <linux/initrd.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#include <asm/bootinfo.h>
178c2ecf20Sopenharmony_ci#include <asm/addrspace.h>
188c2ecf20Sopenharmony_ci#include <asm/fw/fw.h>
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#include "common.h"
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_civoid __init prom_init(void)
238c2ecf20Sopenharmony_ci{
248c2ecf20Sopenharmony_ci	fw_init_cmdline();
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#ifdef CONFIG_BLK_DEV_INITRD
278c2ecf20Sopenharmony_ci	/* Read the initrd address from the firmware environment */
288c2ecf20Sopenharmony_ci	initrd_start = fw_getenvl("initrd_start");
298c2ecf20Sopenharmony_ci	if (initrd_start) {
308c2ecf20Sopenharmony_ci		initrd_start = KSEG0ADDR(initrd_start);
318c2ecf20Sopenharmony_ci		initrd_end = initrd_start + fw_getenvl("initrd_size");
328c2ecf20Sopenharmony_ci	}
338c2ecf20Sopenharmony_ci#endif
348c2ecf20Sopenharmony_ci}
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_civoid __init prom_free_prom_memory(void)
378c2ecf20Sopenharmony_ci{
388c2ecf20Sopenharmony_ci	/* We do not have to prom memory to free */
398c2ecf20Sopenharmony_ci}
40