common.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * (C) Copyright 2008
  3. * Heiko Schocher, DENX Software Engineering, hs@denx.de.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. */
  10. #ifndef __KEYMILE_COMMON_H
  11. #define __KEYMILE_COMMON_H
  12. #define WRG_RESET 0x80
  13. #define H_OPORTS_14 0x40
  14. #define WRG_LED 0x02
  15. #define WRL_BOOT 0x01
  16. #define H_OPORTS_SCC4_ENA 0x10
  17. #define H_OPORTS_SCC4_FD_ENA 0x04
  18. #define H_OPORTS_FCC1_PW_DWN 0x01
  19. #define PIGGY_PRESENT 0x80
  20. struct km_bec_fpga {
  21. unsigned char id;
  22. unsigned char rev;
  23. unsigned char oprth;
  24. unsigned char oprtl;
  25. unsigned char res1[3];
  26. unsigned char bprth;
  27. unsigned char bprtl;
  28. unsigned char res2[6];
  29. unsigned char prst;
  30. unsigned char res3[0xfff0];
  31. unsigned char pgy_id;
  32. unsigned char pgy_rev;
  33. unsigned char pgy_outputs;
  34. unsigned char pgy_eth;
  35. };
  36. #if !defined(CONFIG_PIGGY_MAC_ADRESS_OFFSET)
  37. #define CONFIG_PIGGY_MAC_ADRESS_OFFSET 0
  38. #endif
  39. int ethernet_present(void);
  40. int ivm_read_eeprom(void);
  41. int set_km_env(void);
  42. int fdt_set_node_and_value(void *blob,
  43. char *nodename,
  44. char *regname,
  45. void *var,
  46. int size);
  47. int fdt_get_node_and_value(void *blob,
  48. char *nodename,
  49. char *propname,
  50. void **var);
  51. int i2c_soft_read_pin(void);
  52. #endif /* __KEYMILE_COMMON_H */