2011-11-24 17:18:02 -07:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2009
|
|
|
|
* Stefano Babic, DENX Software Engineering, sbabic@denx.de.
|
|
|
|
*
|
2013-07-08 01:37:19 -06:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2011-11-24 17:18:02 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SYS_PROTO_H_
|
|
|
|
#define _SYS_PROTO_H_
|
|
|
|
|
2013-04-09 15:06:08 -06:00
|
|
|
#include <asm/imx-common/regs-common.h>
|
2014-01-26 10:06:40 -07:00
|
|
|
#include "../arch-imx/cpu.h"
|
2011-11-24 17:18:02 -07:00
|
|
|
|
2014-06-10 02:26:22 -06:00
|
|
|
#define soc_rev() (get_cpu_rev() & 0xFF)
|
|
|
|
#define is_soc_rev(rev) (soc_rev() - rev)
|
|
|
|
|
2014-07-26 12:35:43 -06:00
|
|
|
u32 get_nr_cpus(void);
|
2011-11-24 17:18:02 -07:00
|
|
|
u32 get_cpu_rev(void);
|
2015-05-18 08:02:24 -06:00
|
|
|
u32 get_cpu_speed_grade_hz(void);
|
2015-05-18 07:56:45 -06:00
|
|
|
u32 get_cpu_temp_grade(int *minc, int *maxc);
|
2013-08-29 11:57:10 -06:00
|
|
|
|
|
|
|
/* returns MXC_CPU_ value */
|
|
|
|
#define cpu_type(rev) (((rev) >> 12)&0xff)
|
|
|
|
|
2014-08-20 06:08:59 -06:00
|
|
|
/* both macros return/take MXC_CPU_ constants */
|
|
|
|
#define get_cpu_type() (cpu_type(get_cpu_rev()))
|
|
|
|
#define is_cpu_type(cpu) (get_cpu_type() == cpu)
|
2013-08-29 11:57:10 -06:00
|
|
|
|
2012-10-23 04:57:46 -06:00
|
|
|
const char *get_imx_type(u32 imxtype);
|
2012-10-23 04:57:48 -06:00
|
|
|
unsigned imx_ddr_size(void);
|
2014-11-14 06:27:21 -07:00
|
|
|
void set_chipselect_size(int const);
|
2011-11-24 17:18:02 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initializes on-chip ethernet controllers.
|
|
|
|
* to override, implement board_eth_init()
|
|
|
|
*/
|
|
|
|
|
|
|
|
int fecmxc_initialize(bd_t *bis);
|
2012-04-29 02:11:13 -06:00
|
|
|
u32 get_ahb_clk(void);
|
|
|
|
u32 get_periph_clk(void);
|
2013-04-09 15:06:08 -06:00
|
|
|
|
|
|
|
int mxs_reset_block(struct mxs_register_32 *reg);
|
|
|
|
int mxs_wait_mask_set(struct mxs_register_32 *reg,
|
|
|
|
uint32_t mask,
|
|
|
|
unsigned int timeout);
|
|
|
|
int mxs_wait_mask_clr(struct mxs_register_32 *reg,
|
|
|
|
uint32_t mask,
|
|
|
|
unsigned int timeout);
|
2011-11-24 17:18:02 -07:00
|
|
|
#endif
|