699940805360dbd18cf9108951676eff5d0d4de0
4 * Broadcom's CFE specific prom routines
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
15 #include <linux/types.h>
16 #include <linux/init.h>
18 #include <asm/bootinfo.h>
19 #include <asm/addrspace.h>
22 #include "prom_read.h"
27 #define CFE_EPTSEAL 0x43464531 /* CFE1 is the magic number to recognize CFE
28 from other bootloaders */
32 static u32 cfe_handle
;
36 int __init
cfe_present(void)
39 * This method only works, when we are booted directly from the CFE.
41 u32 a1
= (u32
) fw_arg1
;
46 cfe_handle
= (u32
) fw_arg0
;
47 cfe_entry
= (u32
) fw_arg2
;
48 cfe_seal
= (u32
) fw_arg3
;
50 /* Check for CFE by finding the CFE magic number */
51 if (cfe_seal
!= CFE_EPTSEAL
)
54 /* cfe_a1_val must be 0, because only one CPU present in the ADM5120 */
58 /* The cfe_handle, and the cfe_entry must be kernel mode addresses */
59 if ((cfe_handle
< KSEG0
) || (cfe_entry
< KSEG0
))
66 char *cfe_getenv(char *envname
)