loongson.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2010 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_LOONGSON_CPU_HEADER
  19. #define GRUB_LOONGSON_CPU_HEADER 1
  20. #include <grub/cpu/mips.h>
  21. #define GRUB_CPU_LOONGSON_FLASH_START 0xbfc00000
  22. #define GRUB_CPU_LOONGSON_FLASH_TLB_REFILL 0xbfc00200
  23. #define GRUB_CPU_LOONGSON_FLASH_CACHE_ERROR 0xbfc00300
  24. #define GRUB_CPU_LOONGSON_FLASH_OTHER_EXCEPTION 0xbfc00380
  25. #define GRUB_CPU_LOONGSON_DDR2_BASE 0xaffffe00
  26. #define GRUB_CPU_LOONGSON_DDR2_REG1_HI_8BANKS 0x00000001
  27. #define GRUB_CPU_LOONGSON_DDR2_REG_SIZE 0x8
  28. #define GRUB_CPU_LOONGSON_DDR2_REG_STEP 0x10
  29. #define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG GRUB_CPU_REGISTER_WRAP($16)
  30. #define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_ILINESIZE 0x10
  31. #define GRUB_CPU_LOONGSON_COP0_CACHE_CONFIG_DLINESIZE 0x8
  32. #define GRUB_CPU_LOONGSON_COP0_CACHE_DSIZE_SHIFT 6
  33. #define GRUB_CPU_LOONGSON_COP0_CACHE_ISIZE_SHIFT 9
  34. #define GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_MASK 0x7
  35. #define GRUB_CPU_LOONGSON_COP0_CACHE_SIZE_OFFSET 12
  36. #define GRUB_CPU_LOONGSON_COP0_I_INDEX_INVALIDATE 0
  37. #define GRUB_CPU_LOONGSON_COP0_D_INDEX_TAG_STORE 9
  38. #define GRUB_CPU_LOONGSON_COP0_S_INDEX_TAG_STORE 11
  39. #define GRUB_CPU_LOONGSON_COP0_I_INDEX_BIT_OFFSET 5
  40. #define GRUB_CPU_LOONGSON_COP0_D_INDEX_BIT_OFFSET 5
  41. #define GRUB_CPU_LOONGSON_COP0_S_INDEX_BIT_OFFSET 5
  42. #define GRUB_CPU_LOONGSON_CACHE_ACCELERATED 7
  43. #define GRUB_CPU_LOONGSON_CACHE_UNCACHED 2
  44. #define GRUB_CPU_LOONGSON_CACHE_CACHED 3
  45. #define GRUB_CPU_LOONGSON_CACHE_TYPE_MASK 7
  46. #define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_SMALL 4
  47. #define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_LOG_BIG 5
  48. #define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_SMALL 16
  49. #define GRUB_CPU_LOONGSON_CACHE_LINE_SIZE_BIG 32
  50. #define GRUB_CPU_LOONGSON_I_CACHE_LOG_WAYS 2
  51. #define GRUB_CPU_LOONGSON_D_CACHE_LOG_WAYS 2
  52. #define GRUB_CPU_LOONGSON_S_CACHE_LOG_WAYS 2
  53. /* FIXME: determine dynamically. */
  54. #define GRUB_CPU_LOONGSON_SECONDARY_CACHE_LOG_SIZE 19
  55. #define GRUB_CPU_LOONGSON_COP0_BADVADDR GRUB_CPU_REGISTER_WRAP($8)
  56. #define GRUB_CPU_LOONGSON_COP0_CAUSE GRUB_CPU_REGISTER_WRAP($13)
  57. #define GRUB_CPU_LOONGSON_COP0_EPC GRUB_CPU_REGISTER_WRAP($14)
  58. #define GRUB_CPU_LOONGSON_COP0_PRID GRUB_CPU_REGISTER_WRAP($15)
  59. #define GRUB_CPU_LOONGSON_COP0_CACHE_TAGLO GRUB_CPU_REGISTER_WRAP($28)
  60. #define GRUB_CPU_LOONGSON_COP0_CACHE_TAGHI GRUB_CPU_REGISTER_WRAP($29)
  61. #define GRUB_CPU_LOONGSON_LIOCFG 0xbfe00108
  62. #define GRUB_CPU_LOONGSON_ROM_DELAY_OFFSET 2
  63. #define GRUB_CPU_LOONGSON_ROM_DELAY_MASK 0x1f
  64. #define GRUB_CPU_LOONGSON_CORECFG 0xbfe00180
  65. #define GRUB_CPU_LOONGSON_CORECFG_DISABLE_DDR2_SPACE 0x100
  66. #define GRUB_CPU_LOONGSON_CORECFG_BUFFER_CPU 0x200
  67. #define GRUB_CPU_LOONGSON_PCI_HIT1_SEL_LO 0xbfe00150
  68. #define GRUB_CPU_LOONGSON_PCI_HIT1_SEL_HI 0xbfe00154
  69. #define GRUB_CPU_LOONGSON_GPIOCFG 0xbfe00120
  70. #define GRUB_CPU_YEELOONG_SHUTDOWN_GPIO 1
  71. #endif