davinci_misc.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef __MISC_H
  22. #define __MISC_H
  23. /* pin muxer definitions */
  24. #define PIN_MUX_NUM_FIELDS 8 /* Per register */
  25. #define PIN_MUX_FIELD_SIZE 4 /* n in bits */
  26. #define PIN_MUX_FIELD_MASK ((1 << PIN_MUX_FIELD_SIZE) - 1)
  27. /* pin definition */
  28. struct pinmux_config {
  29. dv_reg *mux; /* Address of mux register */
  30. unsigned char value; /* Value to set in field */
  31. unsigned char field; /* field number */
  32. };
  33. /* pin table definition */
  34. struct pinmux_resource {
  35. const struct pinmux_config *pins;
  36. const int n_pins;
  37. };
  38. #define PINMUX_ITEM(item) { \
  39. .pins = item, \
  40. .n_pins = ARRAY_SIZE(item) \
  41. }
  42. #define HAWKBOARD_KICK0_UNLOCK 0x83e70b13
  43. #define HAWKBOARD_KICK1_UNLOCK 0x95a4f1e0
  44. struct lpsc_resource {
  45. const int lpsc_no;
  46. };
  47. int dvevm_read_mac_address(uint8_t *buf);
  48. void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr);
  49. int davinci_configure_pin_mux(const struct pinmux_config *pins, int n_pins);
  50. int davinci_configure_pin_mux_items(const struct pinmux_resource *item,
  51. int n_items);
  52. #if defined(CONFIG_DRIVER_TI_EMAC) && defined(CONFIG_MACH_DAVINCI_DA850_EVM)
  53. void davinci_emac_mii_mode_sel(int mode_sel);
  54. #endif
  55. #if defined(CONFIG_SOC_DA8XX)
  56. void irq_init(void);
  57. int da8xx_configure_lpsc_items(const struct lpsc_resource *item,
  58. const int n_items);
  59. #endif
  60. #endif /* __MISC_H */