#include <common.h>
#include <asm/io.h>
#include <asm/arch/bits.h>
+#include <asm/arch/clocks.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/sys_info.h>
mode = __raw_readl(CONTROL_STATUS) & (SYSBOOT_MASK);
return mode;
}
+
+/*
+ * get_sys_clkin_sel(): returns the sys_clkin_sel field value based on
+ * input oscillator clock frequency.
+ */
+void get_sys_clkin_sel(u32 osc_clk, u32 *sys_clkin_sel)
+{
+ if (osc_clk == S38_4M)
+ *sys_clkin_sel = 4;
+ else if (osc_clk == S26M)
+ *sys_clkin_sel = 3;
+ else if (osc_clk == S19_2M)
+ *sys_clkin_sel = 2;
+ else if (osc_clk == S13M)
+ *sys_clkin_sel = 1;
+ else if (osc_clk == S12M)
+ *sys_clkin_sel = 0;
+}