blob: bc700d56feceaa845b43368870d158770f923647 [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
14/*
15 * TI AM335x parts define a system EEPROM that defines certain sub-fields.
16 * We use these fields to in turn see what board we are on, and what
17 * that might require us to set or not set.
18 */
19#define HDR_NO_OF_MAC_ADDR 3
20#define HDR_ETH_ALEN 6
21#define HDR_NAME_LEN 8
22
23struct am335x_baseboard_id {
24 unsigned int magic;
25 char name[HDR_NAME_LEN];
26 char version[4];
27 char serial[12];
28 char config[32];
29 char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN];
30};
31
Tom Rini4021fd92013-07-18 15:13:01 -040032static inline int board_is_bone(struct am335x_baseboard_id *header)
33{
34 return !strncmp(header->name, "A335BONE", HDR_NAME_LEN);
35}
36
37static inline int board_is_bone_lt(struct am335x_baseboard_id *header)
38{
39 return !strncmp(header->name, "A335BNLT", HDR_NAME_LEN);
40}
41
42static inline int board_is_evm_sk(struct am335x_baseboard_id *header)
43{
44 return !strncmp("A335X_SK", header->name, HDR_NAME_LEN);
45}
46
47static inline int board_is_idk(struct am335x_baseboard_id *header)
48{
49 return !strncmp(header->config, "SKU#02", 6);
50}
51
52static inline int board_is_gp_evm(struct am335x_baseboard_id *header)
53{
54 return !strncmp("A33515BB", header->name, HDR_NAME_LEN);
55}
56
57static inline int board_is_evm_15_or_later(struct am335x_baseboard_id *header)
58{
59 return (board_is_gp_evm(header) &&
60 strncmp("1.5", header->version, 3) <= 0);
61}
62
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000063/*
64 * We have three pin mux functions that must exist. We must be able to enable
65 * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
66 * main pinmux function that can be overridden to enable all other pinmux that
67 * is required on the board.
68 */
69void enable_uart0_pin_mux(void);
Andrew Bradford65c51ff2012-10-25 08:21:30 -040070void enable_uart1_pin_mux(void);
71void enable_uart2_pin_mux(void);
72void enable_uart3_pin_mux(void);
73void enable_uart4_pin_mux(void);
74void enable_uart5_pin_mux(void);
Peter Korsgaard85ec2db2012-10-18 01:21:09 +000075void enable_i2c0_pin_mux(void);
76void enable_board_pin_mux(struct am335x_baseboard_id *header);
77#endif