blob: 9776df79592825fdfec53caa42f1dfd16e317f58 [file] [log] [blame]
Peter Korsgaard85ec2db2012-10-18 01:21:09 +00001/*
2 * board.h
3 *
4 * TI AM335x boards information header
5 *
6 * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
7 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Peter Korsgaard85ec2db2012-10-18 01:21:09 +00009 */
10
11#ifndef _BOARD_H_
12#define _BOARD_H_
13
Nishanth Menon2afa70d2016-02-24 12:30:55 -060014static inline int board_is_bone(void)
15{
16 return board_ti_is("A335BONE");
17}
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000018
Nishanth Menon2afa70d2016-02-24 12:30:55 -060019static inline int board_is_bone_lt(void)
Tom Rini4021fd92013-07-18 15:13:01 -040020{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060021 return board_ti_is("A335BNLT");
Tom Rini4021fd92013-07-18 15:13:01 -040022}
23
Nishanth Menon2afa70d2016-02-24 12:30:55 -060024static inline int board_is_bbg1(void)
Tom Rini4021fd92013-07-18 15:13:01 -040025{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060026 return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
Tom Rini4021fd92013-07-18 15:13:01 -040027}
28
Nishanth Menon2afa70d2016-02-24 12:30:55 -060029static inline int board_is_evm_sk(void)
Tom Rini4021fd92013-07-18 15:13:01 -040030{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060031 return board_ti_is("A335X_SK");
Tom Rini4021fd92013-07-18 15:13:01 -040032}
33
Nishanth Menon2afa70d2016-02-24 12:30:55 -060034static inline int board_is_idk(void)
Tom Rini4021fd92013-07-18 15:13:01 -040035{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060036 return !strncmp(board_ti_get_config(), "SKU#02", 6);
Tom Rini4021fd92013-07-18 15:13:01 -040037}
38
Nishanth Menon2afa70d2016-02-24 12:30:55 -060039static inline int board_is_gp_evm(void)
Tom Rini4021fd92013-07-18 15:13:01 -040040{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060041 return board_ti_is("A33515BB");
Tom Rini4021fd92013-07-18 15:13:01 -040042}
43
Nishanth Menon2afa70d2016-02-24 12:30:55 -060044static inline int board_is_evm_15_or_later(void)
Tom Rini4021fd92013-07-18 15:13:01 -040045{
Nishanth Menon2afa70d2016-02-24 12:30:55 -060046 return (board_is_gp_evm() &&
47 strncmp("1.5", board_ti_get_rev(), 3) <= 0);
Tom Rini4021fd92013-07-18 15:13:01 -040048}
49
Lokesh Vutlad431b692016-05-16 11:47:22 +053050static inline int board_is_icev2(void)
51{
52 return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);
53}
54
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000055/*
56 * We have three pin mux functions that must exist. We must be able to enable
57 * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
58 * main pinmux function that can be overridden to enable all other pinmux that
59 * is required on the board.
60 */
61void enable_uart0_pin_mux(void);
Andrew Bradford65c51ff2012-10-25 08:21:30 -040062void enable_uart1_pin_mux(void);
63void enable_uart2_pin_mux(void);
64void enable_uart3_pin_mux(void);
65void enable_uart4_pin_mux(void);
66void enable_uart5_pin_mux(void);
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000067void enable_i2c0_pin_mux(void);
Nishanth Menon2afa70d2016-02-24 12:30:55 -060068void enable_board_pin_mux(void);
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000069#endif