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