Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Lokesh Vutla | faa680f | 2013-07-30 11:36:27 +0530 | [diff] [blame] | 2 | /* |
| 3 | * board.h |
| 4 | * |
| 5 | * TI AM437x boards information header |
| 6 | * Derived from AM335x board. |
| 7 | * |
Nishanth Menon | eaa39c6 | 2023-11-01 15:56:03 -0500 | [diff] [blame^] | 8 | * Copyright (C) 2013, Texas Instruments, Incorporated - https://www.ti.com/ |
Lokesh Vutla | faa680f | 2013-07-30 11:36:27 +0530 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _BOARD_H_ |
| 12 | #define _BOARD_H_ |
| 13 | |
Sekhar Nori | 2ab3c49 | 2013-12-10 15:02:15 +0530 | [diff] [blame] | 14 | #include <asm/arch/omap.h> |
| 15 | |
Nishanth Menon | 757a9a0 | 2016-02-24 12:30:56 -0600 | [diff] [blame] | 16 | #define DEV_ATTR_MAX_OFFSET 5 |
| 17 | #define DEV_ATTR_MIN_OFFSET 0 |
Sekhar Nori | 2ab3c49 | 2013-12-10 15:02:15 +0530 | [diff] [blame] | 18 | |
| 19 | static inline int board_is_eposevm(void) |
| 20 | { |
Nishanth Menon | 757a9a0 | 2016-02-24 12:30:56 -0600 | [diff] [blame] | 21 | return board_ti_is("AM43EPOS"); |
Sekhar Nori | 2ab3c49 | 2013-12-10 15:02:15 +0530 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | static inline int board_is_gpevm(void) |
| 25 | { |
Nishanth Menon | 757a9a0 | 2016-02-24 12:30:56 -0600 | [diff] [blame] | 26 | return board_ti_is("AM43__GP"); |
Sekhar Nori | 2ab3c49 | 2013-12-10 15:02:15 +0530 | [diff] [blame] | 27 | } |
| 28 | |
Felipe Balbi | ccc6f84 | 2014-06-10 15:01:20 -0500 | [diff] [blame] | 29 | static inline int board_is_sk(void) |
| 30 | { |
Nishanth Menon | 757a9a0 | 2016-02-24 12:30:56 -0600 | [diff] [blame] | 31 | return board_ti_is("AM43__SK"); |
Felipe Balbi | ccc6f84 | 2014-06-10 15:01:20 -0500 | [diff] [blame] | 32 | } |
| 33 | |
Felipe Balbi | 3dcd6d8 | 2014-12-22 16:26:17 -0600 | [diff] [blame] | 34 | static inline int board_is_idk(void) |
| 35 | { |
Nishanth Menon | 757a9a0 | 2016-02-24 12:30:56 -0600 | [diff] [blame] | 36 | return board_ti_is("AM43_IDK"); |
Felipe Balbi | 3dcd6d8 | 2014-12-22 16:26:17 -0600 | [diff] [blame] | 37 | } |
| 38 | |
Madan Srinivas | 3623502 | 2016-05-19 19:10:48 -0500 | [diff] [blame] | 39 | static inline int board_is_hsevm(void) |
| 40 | { |
| 41 | return board_ti_is("AM43XXHS"); |
| 42 | } |
| 43 | |
| 44 | static inline int board_is_evm(void) |
| 45 | { |
| 46 | return board_is_gpevm() || board_is_hsevm(); |
| 47 | } |
| 48 | |
Franklin S. Cooper Jr | cc76fc4 | 2014-06-27 13:31:14 -0500 | [diff] [blame] | 49 | static inline int board_is_evm_14_or_later(void) |
| 50 | { |
Madan Srinivas | 3623502 | 2016-05-19 19:10:48 -0500 | [diff] [blame] | 51 | return board_is_evm() && strncmp("1.4", board_ti_get_rev(), 3) <= 0; |
Franklin S. Cooper Jr | cc76fc4 | 2014-06-27 13:31:14 -0500 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | static inline int board_is_evm_12_or_later(void) |
| 55 | { |
Madan Srinivas | 3623502 | 2016-05-19 19:10:48 -0500 | [diff] [blame] | 56 | return board_is_evm() && strncmp("1.2", board_ti_get_rev(), 3) <= 0; |
Franklin S. Cooper Jr | cc76fc4 | 2014-06-27 13:31:14 -0500 | [diff] [blame] | 57 | } |
| 58 | |
Lokesh Vutla | faa680f | 2013-07-30 11:36:27 +0530 | [diff] [blame] | 59 | void enable_uart0_pin_mux(void); |
| 60 | void enable_board_pin_mux(void); |
Lokesh Vutla | 42c213a | 2013-12-10 15:02:20 +0530 | [diff] [blame] | 61 | void enable_i2c0_pin_mux(void); |
Lokesh Vutla | faa680f | 2013-07-30 11:36:27 +0530 | [diff] [blame] | 62 | #endif |