generic.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Carsten Langgaard, carstenl@mips.com
  3.  * Copyright (C) 2000 MIPS Technologies, Inc.  All rights reserved.
  4.  *
  5.  * ########################################################################
  6.  *
  7.  *  This program is free software; you can distribute it and/or modify it
  8.  *  under the terms of the GNU General Public License (Version 2) as
  9.  *  published by the Free Software Foundation.
  10.  *
  11.  *  This program is distributed in the hope it will be useful, but WITHOUT
  12.  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13.  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14.  *  for more details.
  15.  *
  16.  *  You should have received a copy of the GNU General Public License along
  17.  *  with this program; if not, write to the Free Software Foundation, Inc.,
  18.  *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  19.  *
  20.  * ########################################################################
  21.  *
  22.  * Defines of the MIPS boards specific address-MAP, registers, etc.
  23.  *
  24.  */
  25. #ifndef _MIPS_GENERIC_H
  26. #define _MIPS_GENERIC_H
  27. #include <linux/config.h>
  28. #include <asm/addrspace.h>
  29. #include <asm/byteorder.h>
  30. #include <asm/mips-boards/bonito64.h>
  31. /*
  32.  * Display register base.
  33.  */
  34. #if defined(CONFIG_MIPS_SEAD)
  35. #define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f0005c0))
  36. #else
  37. #define ASCII_DISPLAY_WORD_BASE    (KSEG1ADDR(0x1f000410))
  38. #define ASCII_DISPLAY_POS_BASE     (KSEG1ADDR(0x1f000418))
  39. #endif
  40. /*
  41.  * Yamon Prom print address.
  42.  */
  43. #define YAMON_PROM_PRINT_ADDR      (KSEG1ADDR(0x1fc00504))
  44. /*
  45.  * Reset register.
  46.  */
  47. #if defined(CONFIG_MIPS_SEAD)
  48. #define SOFTRES_REG       (KSEG1ADDR(0x1e800050))
  49. #define GORESET           0x4d
  50. #else
  51. #define SOFTRES_REG       (KSEG1ADDR(0x1f000500))
  52. #define GORESET           0x42
  53. #endif
  54. /*
  55.  * Revision register.
  56.  */
  57. #define MIPS_REVISION_REG                  (KSEG1ADDR(0x1fc00010))
  58. #define MIPS_REVISION_CORID_QED_RM5261     0
  59. #define MIPS_REVISION_CORID_CORE_LV        1
  60. #define MIPS_REVISION_CORID_BONITO64       2
  61. #define MIPS_REVISION_CORID_CORE_20K       3
  62. #define MIPS_REVISION_CORID_CORE_FPGA      4
  63. #define MIPS_REVISION_CORID_CORE_MSC       5
  64. #define MIPS_REVISION_CORID (((*(volatile u32 *)(MIPS_REVISION_REG)) >> 10) & 0x3f)
  65. extern unsigned int mips_revision_corid;
  66. /*
  67.  * Galileo GT64120 system controller register base.
  68.  */
  69. #define MIPS_GT_BASE    (KSEG1ADDR(0x1be00000))
  70. /*
  71.  * Because of the way the internal register works on the Galileo chip,
  72.  * we need to swap the bytes when running bigendian.
  73.  */
  74. #define GT_WRITE(ofs, data)  
  75.              *(volatile u32 *)(MIPS_GT_BASE+ofs) = cpu_to_le32(data)
  76. #define GT_READ(ofs, data)   
  77.              data = le32_to_cpu(*(volatile u32 *)(MIPS_GT_BASE+ofs))
  78. #define GT_PCI_WRITE(ofs, data)  
  79. *(volatile u32 *)(MIPS_GT_BASE+ofs) = data
  80. #define GT_PCI_READ(ofs, data)   
  81. data = *(volatile u32 *)(MIPS_GT_BASE+ofs)
  82. /*
  83.  * Algorithmics Bonito64 system controller register base.
  84.  */
  85. static char * const _bonito = (char *)KSEG1ADDR(BONITO_REG_BASE);
  86. /*
  87.  * MIPS System controller PCI register base.
  88.  */
  89. #define MSC01_PCI_REG_BASE  (KSEG1ADDR(0x1bd00000))
  90. #define MSC_WRITE(reg, data)  
  91. *(volatile u32 *)(reg) = data
  92. #define MSC_READ(reg, data)   
  93. data = *(volatile u32 *)(reg)
  94. #endif  /* !(_MIPS_GENERIC_H) */