blob: ddbd5d04594f3304e1e24799e97cb4d2d6b65def [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Gilles Gameiroa2bc4322015-02-10 01:36:01 -08002/*
3 * board.c
4 *
5 * Board functions for Birdland Audio BAV335x Network Processor
6 *
7 * Copyright (c) 2012-2014, Birdland Audio - http://birdland.com/oem
8 *
Gilles Gameiroa2bc4322015-02-10 01:36:01 -08009 */
10
11#ifndef _BOARD_H_
12#define _BOARD_H_
13
14/* Serial MagicE: AA 55 BA BE */
15#define BOARD_MAGIC 0xBEBA55AA
16enum board_type {UNKNOWN, BAV335A, BAV335B};
17
18
19/*
20 * The BAV335x may use a built-in read-only serial EEProm.
21 * The Evaluation board, disables the write-protect so the Serial-EE
22 * Can be programmed during manufacturing to store fields such as
23 * a board serial number, ethernet mac address and other user fields.
24 * Additionally, the Serial-EE can store the specific version of the
25 * board it runs on, and overwrite the defaults in _defconfig
26 */
27#define HDR_NO_OF_MAC_ADDR 3
28#define HDR_ETH_ALEN 6
29#define HDR_NAME_LEN 8
30
31struct board_eeconfig {
32 unsigned int magic;
33 char name[HDR_NAME_LEN]; /* BAV3354 */
34 char version[4]; /* 0B20 - Rev.B2 */
Gilles Gameirob81bdf62015-03-23 23:13:03 -070035 char serial[16];
Gilles Gameiroa2bc4322015-02-10 01:36:01 -080036 char config[32];
37 char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN];
38};
39
40enum board_type get_board_type(bool verbose_debug_output);
41
42
43/*
44 * We have three pin mux functions that must exist. We must be able to enable
45 * uart0, for initial output and i2c0 to read the main EEPROM. We then have a
46 * main pinmux function that can be overridden to enable all other pinmux that
47 * is required on the board.
48 */
49void enable_uart0_pin_mux(void);
50void enable_uart1_pin_mux(void);
51void enable_uart2_pin_mux(void);
52void enable_uart3_pin_mux(void);
53void enable_uart4_pin_mux(void);
54void enable_uart5_pin_mux(void);
55void enable_i2c0_pin_mux(void);
56void enable_board_pin_mux(enum board_type board);
57
58#endif