pch_common.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2016 Google, Inc
  3. *
  4. * SPDX-License-Identifier: GPL-2.0
  5. */
  6. #ifndef __asm_pch_common_h
  7. #define __asm_pch_common_h
  8. /* Common Intel SATA registers */
  9. #define SATA_SIRI 0xa0 /* SATA Indexed Register Index */
  10. #define SATA_SIRD 0xa4 /* SATA Indexed Register Data */
  11. #define SATA_SP 0xd0 /* Scratchpad */
  12. #define INTR_LN 0x3c
  13. #define IDE_TIM_PRI 0x40 /* IDE timings, primary */
  14. #define IDE_DECODE_ENABLE (1 << 15)
  15. #define IDE_SITRE (1 << 14)
  16. #define IDE_ISP_5_CLOCKS (0 << 12)
  17. #define IDE_ISP_4_CLOCKS (1 << 12)
  18. #define IDE_ISP_3_CLOCKS (2 << 12)
  19. #define IDE_RCT_4_CLOCKS (0 << 8)
  20. #define IDE_RCT_3_CLOCKS (1 << 8)
  21. #define IDE_RCT_2_CLOCKS (2 << 8)
  22. #define IDE_RCT_1_CLOCKS (3 << 8)
  23. #define IDE_DTE1 (1 << 7)
  24. #define IDE_PPE1 (1 << 6)
  25. #define IDE_IE1 (1 << 5)
  26. #define IDE_TIME1 (1 << 4)
  27. #define IDE_DTE0 (1 << 3)
  28. #define IDE_PPE0 (1 << 2)
  29. #define IDE_IE0 (1 << 1)
  30. #define IDE_TIME0 (1 << 0)
  31. #define IDE_TIM_SEC 0x42 /* IDE timings, secondary */
  32. #define SERIRQ_CNTL 0x64
  33. /**
  34. * pch_common_sir_read() - Read from a SATA indexed register
  35. *
  36. * @dev: SATA device
  37. * @idx: Register index to read
  38. * @return value read from register
  39. */
  40. u32 pch_common_sir_read(struct udevice *dev, int idx);
  41. /**
  42. * pch_common_sir_write() - Write to a SATA indexed register
  43. *
  44. * @dev: SATA device
  45. * @idx: Register index to write
  46. * @value: Value to write
  47. */
  48. void pch_common_sir_write(struct udevice *dev, int idx, u32 value);
  49. #endif