soc.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Copyright 2015 Freescale Semiconductor
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_
  7. #define _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_
  8. #ifdef CONFIG_SYS_FSL_CCSR_GUR_LE
  9. #define gur_in32(a) in_le32(a)
  10. #define gur_out32(a, v) out_le32(a, v)
  11. #elif defined(CONFIG_SYS_FSL_CCSR_GUR_BE)
  12. #define gur_in32(a) in_be32(a)
  13. #define gur_out32(a, v) out_be32(a, v)
  14. #endif
  15. #ifdef CONFIG_SYS_FSL_CCSR_SCFG_LE
  16. #define scfg_in32(a) in_le32(a)
  17. #define scfg_out32(a, v) out_le32(a, v)
  18. #elif defined(CONFIG_SYS_FSL_CCSR_SCFG_BE)
  19. #define scfg_in32(a) in_be32(a)
  20. #define scfg_out32(a, v) out_be32(a, v)
  21. #endif
  22. #ifdef CONFIG_SYS_FSL_PEX_LUT_LE
  23. #define pex_lut_in32(a) in_le32(a)
  24. #define pex_lut_out32(a, v) out_le32(a, v)
  25. #elif defined(CONFIG_SYS_FSL_PEX_LUT_BE)
  26. #define pex_lut_in32(a) in_be32(a)
  27. #define pex_lut_out32(a, v) out_be32(a, v)
  28. #endif
  29. #ifndef __ASSEMBLY__
  30. struct cpu_type {
  31. char name[15];
  32. u32 soc_ver;
  33. u32 num_cores;
  34. };
  35. #define CPU_TYPE_ENTRY(n, v, nc) \
  36. { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)}
  37. #endif
  38. #define SVR_WO_E 0xFFFFFE
  39. #define SVR_LS1012A 0x870400
  40. #define SVR_LS1043A 0x879200
  41. #define SVR_LS1023A 0x879208
  42. #define SVR_LS1046A 0x870700
  43. #define SVR_LS1026A 0x870708
  44. #define SVR_LS2045A 0x870120
  45. #define SVR_LS2080A 0x870110
  46. #define SVR_LS2085A 0x870100
  47. #define SVR_LS2040A 0x870130
  48. #define SVR_LS2088A 0x870900
  49. #define SVR_LS2084A 0x870910
  50. #define SVR_LS2048A 0x870920
  51. #define SVR_LS2044A 0x870930
  52. #define SVR_DEV_LS2080A 0x8701
  53. #define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
  54. #define SVR_MIN(svr) (((svr) >> 0) & 0xf)
  55. #define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
  56. #define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
  57. #define IS_SVR_REV(svr, maj, min) \
  58. ((SVR_MAJ(svr) == (maj)) && (SVR_MIN(svr) == (min)))
  59. /* ahci port register default value */
  60. #define AHCI_PORT_PHY_1_CFG 0xa003fffe
  61. #define AHCI_PORT_TRANS_CFG 0x08000029
  62. #define AHCI_PORT_AXICC_CFG 0x3fffffff
  63. #ifndef __ASSEMBLY__
  64. /* AHCI (sata) register map */
  65. struct ccsr_ahci {
  66. u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
  67. u32 pcfg; /* port config */
  68. u32 ppcfg; /* port phy1 config */
  69. u32 pp2c; /* port phy2 config */
  70. u32 pp3c; /* port phy3 config */
  71. u32 pp4c; /* port phy4 config */
  72. u32 pp5c; /* port phy5 config */
  73. u32 axicc; /* AXI cache control */
  74. u32 paxic; /* port AXI config */
  75. u32 axipc; /* AXI PROT control */
  76. u32 ptc; /* port Trans Config */
  77. u32 pts; /* port Trans Status */
  78. u32 plc; /* port link config */
  79. u32 plc1; /* port link config1 */
  80. u32 plc2; /* port link config2 */
  81. u32 pls; /* port link status */
  82. u32 pls1; /* port link status1 */
  83. u32 pcmdc; /* port CMD config */
  84. u32 ppcs; /* port phy control status */
  85. u32 pberr; /* port 0/1 BIST error */
  86. u32 cmds; /* port 0/1 CMD status error */
  87. };
  88. #ifdef CONFIG_FSL_LSCH3
  89. void fsl_lsch3_early_init_f(void);
  90. #elif defined(CONFIG_FSL_LSCH2)
  91. void fsl_lsch2_early_init_f(void);
  92. #endif
  93. void cpu_name(char *name);
  94. #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
  95. void erratum_a009635(void);
  96. #endif
  97. #ifdef CONFIG_SYS_FSL_ERRATUM_A010315
  98. void erratum_a010315(void);
  99. #endif
  100. bool soc_has_dp_ddr(void);
  101. bool soc_has_aiop(void);
  102. #endif
  103. #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */