Peter Korsgaard | e363426 | 2012-10-18 01:21:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * board.h |
| 3 | * |
| 4 | * TI AM335x boards information header |
| 5 | * |
| 6 | * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/ |
| 7 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Peter Korsgaard | e363426 | 2012-10-18 01:21:09 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _BOARD_H_ |
| 12 | #define _BOARD_H_ |
| 13 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 14 | static inline int board_is_bone(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 15 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 16 | return board_ti_is("A335BONE"); |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 17 | } |
| 18 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 19 | static inline int board_is_bone_lt(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 20 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 21 | return board_ti_is("A335BNLT"); |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 22 | } |
| 23 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 24 | static inline int board_is_bbg1(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 25 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 26 | return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4); |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 27 | } |
| 28 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 29 | static inline int board_is_evm_sk(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 30 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 31 | return board_ti_is("A335X_SK"); |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 32 | } |
| 33 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 34 | static inline int board_is_idk(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 35 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 36 | return !strncmp(board_ti_get_config(), "SKU#02", 6); |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 37 | } |
| 38 | |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 39 | static inline int board_is_gp_evm(void) |
Tom Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 40 | { |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 41 | return board_ti_is("A33515BB"); |
| 42 | } |
| 43 | |
| 44 | static 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 Rini | ace4275 | 2013-07-18 15:13:01 -0400 | [diff] [blame] | 48 | } |
| 49 | |
Lokesh Vutla | a964332 | 2016-05-16 11:47:22 +0530 | [diff] [blame] | 50 | static inline int board_is_icev2(void) |
| 51 | { |
| 52 | return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1); |
| 53 | } |
| 54 | |
Peter Korsgaard | e363426 | 2012-10-18 01:21:09 +0000 | [diff] [blame] | 55 | /* |
| 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 | */ |
| 61 | void enable_uart0_pin_mux(void); |
Andrew Bradford | 6422b70 | 2012-10-25 08:21:30 -0400 | [diff] [blame] | 62 | void enable_uart1_pin_mux(void); |
| 63 | void enable_uart2_pin_mux(void); |
| 64 | void enable_uart3_pin_mux(void); |
| 65 | void enable_uart4_pin_mux(void); |
| 66 | void enable_uart5_pin_mux(void); |
Peter Korsgaard | e363426 | 2012-10-18 01:21:09 +0000 | [diff] [blame] | 67 | void enable_i2c0_pin_mux(void); |
Nishanth Menon | 770e68c | 2016-02-24 12:30:55 -0600 | [diff] [blame] | 68 | void enable_board_pin_mux(void); |
Peter Korsgaard | e363426 | 2012-10-18 01:21:09 +0000 | [diff] [blame] | 69 | #endif |