blob: bbcf601f38fb0ffa32ca352953ba305e0a62449e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
TsiChungLiew8999e6b2008-01-15 13:37:34 -06002/*
3 *
4 * (C) Copyright 2000-2003
5 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 *
7 * Copyright (C) 2004-2007 Freescale Semiconductor, Inc.
8 * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
TsiChungLiew8999e6b2008-01-15 13:37:34 -06009 */
10
11#include <common.h>
Simon Glass85d65312019-12-28 10:44:58 -070012#include <clock_legacy.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060013#include <asm/global_data.h>
TsiChungLiew8999e6b2008-01-15 13:37:34 -060014#include <asm/processor.h>
15
16#include <asm/immap.h>
17
John Rigby0d21ed02010-12-20 18:27:51 -070018DECLARE_GLOBAL_DATA_PTR;
19
TsiChungLiew8999e6b2008-01-15 13:37:34 -060020/*
21 * get_clocks() fills in gd->cpu_clock and gd->bus_clk
22 */
23int get_clocks(void)
24{
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020025 gd->bus_clk = CONFIG_SYS_CLK;
TsiChungLiew8999e6b2008-01-15 13:37:34 -060026 gd->cpu_clk = (gd->bus_clk * 2);
TsiChung Liew0c1e3252008-08-19 03:01:19 +060027
Heiko Schocherf2850742012-10-24 13:48:22 +020028#ifdef CONFIG_SYS_I2C_FSL
Simon Glassc2baaec2012-12-13 20:48:49 +000029 gd->arch.i2c1_clk = gd->bus_clk;
TsiChung Liew0c1e3252008-08-19 03:01:19 +060030#endif
31
TsiChungLiew8999e6b2008-01-15 13:37:34 -060032 return (0);
33}