soc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. struct cpu_type {
  30. char name[15];
  31. u32 soc_ver;
  32. u32 num_cores;
  33. };
  34. #define CPU_TYPE_ENTRY(n, v, nc) \
  35. { .name = #n, .soc_ver = SVR_##v, .num_cores = (nc)}
  36. #define SVR_WO_E 0xFFFFFE
  37. #define SVR_LS1043 0x879204
  38. #define SVR_LS2045 0x870120
  39. #define SVR_LS2080 0x870110
  40. #define SVR_LS2085 0x870100
  41. #define SVR_LS2040 0x870130
  42. #define SVR_MAJ(svr) (((svr) >> 4) & 0xf)
  43. #define SVR_MIN(svr) (((svr) >> 0) & 0xf)
  44. #define SVR_SOC_VER(svr) (((svr) >> 8) & SVR_WO_E)
  45. #define IS_E_PROCESSOR(svr) (!((svr >> 8) & 0x1))
  46. /* ahci port register default value */
  47. #define AHCI_PORT_PHY_1_CFG 0xa003fffe
  48. #define AHCI_PORT_PHY_2_CFG 0x28184d1f
  49. #define AHCI_PORT_PHY_3_CFG 0x0e081509
  50. #define AHCI_PORT_TRANS_CFG 0x08000029
  51. /* AHCI (sata) register map */
  52. struct ccsr_ahci {
  53. u32 res1[0xa4/4]; /* 0x0 - 0xa4 */
  54. u32 pcfg; /* port config */
  55. u32 ppcfg; /* port phy1 config */
  56. u32 pp2c; /* port phy2 config */
  57. u32 pp3c; /* port phy3 config */
  58. u32 pp4c; /* port phy4 config */
  59. u32 pp5c; /* port phy5 config */
  60. u32 axicc; /* AXI cache control */
  61. u32 paxic; /* port AXI config */
  62. u32 axipc; /* AXI PROT control */
  63. u32 ptc; /* port Trans Config */
  64. u32 pts; /* port Trans Status */
  65. u32 plc; /* port link config */
  66. u32 plc1; /* port link config1 */
  67. u32 plc2; /* port link config2 */
  68. u32 pls; /* port link status */
  69. u32 pls1; /* port link status1 */
  70. u32 pcmdc; /* port CMD config */
  71. u32 ppcs; /* port phy control status */
  72. u32 pberr; /* port 0/1 BIST error */
  73. u32 cmds; /* port 0/1 CMD status error */
  74. };
  75. #ifdef CONFIG_FSL_LSCH3
  76. void fsl_lsch3_early_init_f(void);
  77. #elif defined(CONFIG_FSL_LSCH2)
  78. void fsl_lsch2_early_init_f(void);
  79. #endif
  80. void cpu_name(char *name);
  81. #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
  82. void erratum_a009635(void);
  83. #endif
  84. #endif /* _ASM_ARMV8_FSL_LAYERSCAPE_SOC_H_ */