common.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifdef CONFIG_KEYMILE_HDLC_ENET
  42. int keymile_hdlc_enet_initialize(bd_t *bis);
  43. #endif
  44. int set_km_env(void);
  45. int fdt_set_node_and_value(void *blob,
  46. char *nodename,
  47. char *regname,
  48. void *var,
  49. int size);
  50. int fdt_get_node_and_value(void *blob,
  51. char *nodename,
  52. char *propname,
  53. void **var);
  54. int i2c_soft_read_pin(void);
  55. #endif /* __KEYMILE_COMMON_H */