vid.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014 Freescale Semiconductor, Inc.
  4. * Copyright 2020 NXP
  5. */
  6. #ifndef __VID_H_
  7. #define __VID_H_
  8. /* IR36021 command codes */
  9. #define IR36021_LOOP1_MANUAL_ID_OFFSET 0x6A
  10. #define IR36021_LOOP1_VOUT_OFFSET 0x9A
  11. #define IR36021_MFR_ID_OFFSET 0x92
  12. #define IR36021_MFR_ID 0x43
  13. #define IR36021_INTEL_MODE_OFFSET 0x14
  14. #define IR36021_MODE_MASK 0x20
  15. #define IR36021_INTEL_MODE 0x00
  16. #define IR36021_AMD_MODE 0x20
  17. /* Step the IR regulator in 5mV increments */
  18. #define IR_VDD_STEP_DOWN 5
  19. #define IR_VDD_STEP_UP 5
  20. /* LTC3882 */
  21. #define PMBUS_CMD_WRITE_PROTECT 0x10
  22. /*
  23. * WRITE_PROTECT command supported values
  24. * 0x80: Disable all writes except WRITE_PROTECT, PAGE,
  25. * STORE_USER_ALL and MFR_EE_UNLOCK commands.
  26. * 0x40: Disable all writes except WRITE_PROTECT, PAGE, STORE_USER_ALL,
  27. * MFR_EE_UNLOCK, OPERATION, CLEAR_PEAKS and CLEAR_FAULTS commands.
  28. * Individual faults can also be cleared by writing a 1 to the
  29. * respective status bit.
  30. * 0x20: Disable all writes except WRITE_PROTECT, PAGE, STORE_USER_ ALL,
  31. * MFR_EE_UNLOCK, OPERATION, CLEAR_PEAKS, CLEAR_FAULTS, ON_OFF_CONFIG
  32. * and VOUT_COMMAND commands. Individual faults can be cleared by
  33. * writing a 1 to the respective status bit.
  34. * 0x00: Enables write to all commands
  35. */
  36. #define EN_WRITE_ALL_CMD (0)
  37. #ifdef CONFIG_TARGET_LX2160ARDB
  38. /* The lowest and highest voltage allowed*/
  39. #define VDD_MV_MIN 775
  40. #define VDD_MV_MAX 855
  41. #endif
  42. #if defined(CONFIG_TARGET_LX2160AQDS) || defined(CONFIG_TARGET_LX2162AQDS)
  43. /* The lowest and highest voltage allowed*/
  44. #define VDD_MV_MIN 775
  45. #define VDD_MV_MAX 925
  46. #endif
  47. /* PM Bus commands code for LTC3882*/
  48. #define PWM_CHANNEL0 0x0
  49. #define PMBUS_CMD_PAGE 0x0
  50. #define PMBUS_CMD_READ_VOUT 0x8B
  51. #define PMBUS_CMD_VOUT_MODE 0x20
  52. #define PMBUS_CMD_VOUT_COMMAND 0x21
  53. #define PMBUS_CMD_PAGE_PLUS_WRITE 0x05
  54. #if defined(CONFIG_TARGET_LX2160AQDS) || defined(CONFIG_TARGET_LX2162AQDS) || \
  55. defined(CONFIG_TARGET_LX2160ARDB)
  56. /* Voltage monitor on channel 2*/
  57. #define I2C_VOL_MONITOR_BUS_V_OFFSET 0x2
  58. #define I2C_VOL_MONITOR_BUS_V_OVF 0x1
  59. #define I2C_VOL_MONITOR_BUS_V_SHIFT 3
  60. #define I2C_VOL_MONITOR_ADDR 0x63
  61. #define I2C_MUX_CH_VOL_MONITOR 0xA
  62. #endif
  63. int adjust_vdd(ulong vdd_override);
  64. u16 soc_get_fuse_vid(int vid_index);
  65. #endif /* __VID_H_ */