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