1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12#include <platsupport/i2c.h> 13 14#include "../../arch/arm/clock.h" 15#include "../../services.h" 16#include <assert.h> 17#include <string.h> 18#include <utils/util.h> 19 20static struct clock master_clk = { CLK_OPS_DEFAULT(MASTER) }; 21static struct clock sp804_clk = { CLK_OPS_DEFAULT(SP804) }; 22 23int 24clock_sys_init(ps_io_ops_t* o, clock_sys_t* clock_sys) 25{ 26 clock_sys->priv = (void*)0xdeadbeef; 27 clock_sys->get_clock = &ps_get_clock; 28 clock_sys->gate_enable = NULL; 29 return 0; 30} 31 32void 33clk_print_clock_tree(clock_sys_t* sys) 34{ 35 clk_t *clk = clk_get_clock(sys, CLK_MASTER); 36 clk_print_tree(clk, ""); 37} 38 39clk_t* ps_clocks[] = { 40 [CLK_MASTER] = &master_clk, 41 [CLK_SP804] = &sp804_clk, 42}; 43 44/* These frequencies are NOT the recommended 45 * frequencies. They are to be used when we 46 * need to make assumptions about what u-boot 47 * has left us with. */ 48freq_t ps_freq_default[] = { 49 [CLK_MASTER] = 0 * MHZ, 50 [CLK_SP804] = 250 * MHZ, 51}; 52