2012-10-18 01:21:09 +00:00
|
|
|
/*
|
|
|
|
* board.h
|
|
|
|
*
|
|
|
|
* TI AM335x boards information header
|
|
|
|
*
|
|
|
|
* Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2012-10-18 01:21:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BOARD_H_
|
|
|
|
#define _BOARD_H_
|
|
|
|
|
2016-12-09 10:29:13 +00:00
|
|
|
/**
|
|
|
|
* AM335X (EMIF_4D) EMIF REG_COS_COUNT_1, REG_COS_COUNT_2, and
|
|
|
|
* REG_PR_OLD_COUNT values to avoid LCDC DMA FIFO underflows and Frame
|
|
|
|
* Synchronization Lost errors. The values are the biggest that work
|
|
|
|
* reliably with offered video modes and the memory subsystem on the
|
|
|
|
* boards. These register have are briefly documented in "7.3.3.5.2
|
|
|
|
* Command Starvation" section of AM335x TRM. The REG_COS_COUNT_1 and
|
|
|
|
* REG_COS_COUNT_2 do not have any effect on current versions of
|
|
|
|
* AM335x.
|
|
|
|
*/
|
|
|
|
#define EMIF_OCP_CONFIG_BEAGLEBONE_BLACK 0x00141414
|
|
|
|
#define EMIF_OCP_CONFIG_AM335X_EVM 0x003d3d3d
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_bone(void)
|
|
|
|
{
|
|
|
|
return board_ti_is("A335BONE");
|
|
|
|
}
|
2012-10-18 01:21:09 +00:00
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_bone_lt(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return board_ti_is("A335BNLT");
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_bbg1(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2017-06-10 07:52:56 +00:00
|
|
|
static inline int board_is_beaglebonex(void)
|
|
|
|
{
|
|
|
|
return board_is_bone() || board_is_bone_lt() || board_is_bbg1();
|
|
|
|
}
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_evm_sk(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return board_ti_is("A335X_SK");
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_idk(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return !strncmp(board_ti_get_config(), "SKU#02", 6);
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_gp_evm(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return board_ti_is("A33515BB");
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2016-02-24 18:30:55 +00:00
|
|
|
static inline int board_is_evm_15_or_later(void)
|
2013-07-18 19:13:01 +00:00
|
|
|
{
|
2016-02-24 18:30:55 +00:00
|
|
|
return (board_is_gp_evm() &&
|
|
|
|
strncmp("1.5", board_ti_get_rev(), 3) <= 0);
|
2013-07-18 19:13:01 +00:00
|
|
|
}
|
|
|
|
|
2016-05-16 06:17:22 +00:00
|
|
|
static inline int board_is_icev2(void)
|
|
|
|
{
|
|
|
|
return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);
|
|
|
|
}
|
|
|
|
|
2012-10-18 01:21:09 +00:00
|
|
|
/*
|
|
|
|
* We have three pin mux functions that must exist. We must be able to enable
|
|
|
|
* uart0, for initial output and i2c0 to read the main EEPROM. We then have a
|
|
|
|
* main pinmux function that can be overridden to enable all other pinmux that
|
|
|
|
* is required on the board.
|
|
|
|
*/
|
|
|
|
void enable_uart0_pin_mux(void);
|
2012-10-25 12:21:30 +00:00
|
|
|
void enable_uart1_pin_mux(void);
|
|
|
|
void enable_uart2_pin_mux(void);
|
|
|
|
void enable_uart3_pin_mux(void);
|
|
|
|
void enable_uart4_pin_mux(void);
|
|
|
|
void enable_uart5_pin_mux(void);
|
2012-10-18 01:21:09 +00:00
|
|
|
void enable_i2c0_pin_mux(void);
|
2016-02-24 18:30:55 +00:00
|
|
|
void enable_board_pin_mux(void);
|
2012-10-18 01:21:09 +00:00
|
|
|
#endif
|