blob: 9776df79592825fdfec53caa42f1dfd16e317f58 [file] [log] [blame]
Peter Korsgaarde3634262012-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 Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Peter Korsgaarde3634262012-10-18 01:21:09 +00009 */
10
11#ifndef _BOARD_H_
12#define _BOARD_H_
13
Nishanth Menon770e68c2016-02-24 12:30:55 -060014static inline int board_is_bone(void)
Tom Riniace42752013-07-18 15:13:01 -040015{
Nishanth Menon770e68c2016-02-24 12:30:55 -060016 return board_ti_is("A335BONE");
Tom Riniace42752013-07-18 15:13:01 -040017}
18
Nishanth Menon770e68c2016-02-24 12:30:55 -060019static inline int board_is_bone_lt(void)
Tom Riniace42752013-07-18 15:13:01 -040020{
Nishanth Menon770e68c2016-02-24 12:30:55 -060021 return board_ti_is("A335BNLT");
Tom Riniace42752013-07-18 15:13:01 -040022}
23
Nishanth Menon770e68c2016-02-24 12:30:55 -060024static inline int board_is_bbg1(void)
Tom Riniace42752013-07-18 15:13:01 -040025{
Nishanth Menon770e68c2016-02-24 12:30:55 -060026 return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
Tom Riniace42752013-07-18 15:13:01 -040027}
28
Nishanth Menon770e68c2016-02-24 12:30:55 -060029static inline int board_is_evm_sk(void)
Tom Riniace42752013-07-18 15:13:01 -040030{
Nishanth Menon770e68c2016-02-24 12:30:55 -060031 return board_ti_is("A335X_SK");
Tom Riniace42752013-07-18 15:13:01 -040032}
33
Nishanth Menon770e68c2016-02-24 12:30:55 -060034static inline int board_is_idk(void)
Tom Riniace42752013-07-18 15:13:01 -040035{
Nishanth Menon770e68c2016-02-24 12:30:55 -060036 return !strncmp(board_ti_get_config(), "SKU#02", 6);
Tom Riniace42752013-07-18 15:13:01 -040037}
38
Nishanth Menon770e68c2016-02-24 12:30:55 -060039static inline int board_is_gp_evm(void)
Tom Riniace42752013-07-18 15:13:01 -040040{
Nishanth Menon770e68c2016-02-24 12:30:55 -060041 return board_ti_is("A33515BB");
42}
43
44static inline int board_is_evm_15_or_later(void)
45{
46 return (board_is_gp_evm() &&
47 strncmp("1.5", board_ti_get_rev(), 3) <= 0);
Tom Riniace42752013-07-18 15:13:01 -040048}
49
Lokesh Vutlaa9643322016-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 Korsgaarde3634262012-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 Bradford6422b702012-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 Korsgaarde3634262012-10-18 01:21:09 +000067void enable_i2c0_pin_mux(void);
Nishanth Menon770e68c2016-02-24 12:30:55 -060068void enable_board_pin_mux(void);
Peter Korsgaarde3634262012-10-18 01:21:09 +000069#endif