board.h 1.6 KB

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