2 * Broadcom's CFE specific prom routines
4 * Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
12 #include <linux/types.h>
13 #include <linux/init.h>
15 #include <asm/bootinfo.h>
16 #include <asm/addrspace.h>
19 #include "prom_read.h"
24 #define CFE_EPTSEAL 0x43464531 /* CFE1 is the magic number to recognize CFE
25 from other bootloaders */
29 static u32 cfe_handle;
33 int __init cfe_present(void)
36 * This method only works, when we are booted directly from the CFE.
38 u32 a1 = (u32) fw_arg1;
43 cfe_handle = (u32) fw_arg0;
44 cfe_entry = (u32) fw_arg2;
45 cfe_seal = (u32) fw_arg3;
47 /* Check for CFE by finding the CFE magic number */
48 if (cfe_seal != CFE_EPTSEAL)
51 /* cfe_a1_val must be 0, because only one CPU present in the ADM5120 */
55 /* The cfe_handle, and the cfe_entry must be kernel mode addresses */
56 if ((cfe_handle < KSEG0) || (cfe_entry < KSEG0))
63 char *cfe_getenv(char *envname)