features.txt 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. ===========================
  2. FUJITSU FR-V LINUX FEATURES
  3. ===========================
  4. This kernel port has a number of features of which the user should be aware:
  5. (*) Linux and uClinux
  6. The FR-V architecture port supports both normal MMU linux and uClinux out
  7. of the same sources.
  8. (*) CPU support
  9. Support for the FR401, FR403, FR405, FR451 and FR555 CPUs should work with
  10. the same uClinux kernel configuration.
  11. In normal (MMU) Linux mode, only the FR451 CPU will work as that is the
  12. only one with a suitably featured CPU.
  13. The kernel is written and compiled with the assumption that only the
  14. bottom 32 GR registers and no FR registers will be used by the kernel
  15. itself, however all extra userspace registers will be saved on context
  16. switch. Note that since most CPUs can't support lazy switching, no attempt
  17. is made to do lazy register saving where that would be possible (FR555
  18. only currently).
  19. (*) Board support
  20. The board on which the kernel will run can be configured on the "Processor
  21. type and features" configuration tab.
  22. Set the System to "MB93093-PDK" to boot from the MB93093 (FR403) PDK.
  23. Set the System to "MB93091-VDK" to boot from the CB11, CB30, CB41, CB60,
  24. CB70 or CB451 VDK boards. Set the Motherboard setting to "MB93090-MB00" to
  25. boot with the standard ATA90590B VDK motherboard, and set it to "None" to
  26. boot without any motherboard.
  27. (*) Binary Formats
  28. The only userspace binary format supported is FDPIC ELF. Normal ELF, FLAT
  29. and AOUT binaries are not supported for this architecture.
  30. FDPIC ELF supports shared library and program interpreter facilities.
  31. (*) Scheduler Speed
  32. The kernel scheduler runs at 100Hz irrespective of the clock speed on this
  33. architecture. This value is set in asm/param.h (see the HZ macro defined
  34. there).
  35. (*) Normal (MMU) Linux Memory Layout.
  36. See mmu-layout.txt in this directory for a description of the normal linux
  37. memory layout
  38. See include/asm-frv/mem-layout.h for constants pertaining to the memory
  39. layout.
  40. See include/asm-frv/mb-regs.h for the constants pertaining to the I/O bus
  41. controller configuration.
  42. (*) uClinux Memory Layout
  43. The memory layout used by the uClinux kernel is as follows:
  44. 0x00000000 - 0x00000FFF Null pointer catch page
  45. 0x20000000 - 0x200FFFFF CS2# [PDK] FPGA
  46. 0xC0000000 - 0xCFFFFFFF SDRAM
  47. 0xC0000000 Base of Linux kernel image
  48. 0xE0000000 - 0xEFFFFFFF CS2# [VDK] SLBUS/PCI window
  49. 0xF0000000 - 0xF0FFFFFF CS5# MB93493 CSC area (DAV daughter board)
  50. 0xF1000000 - 0xF1FFFFFF CS7# [CB70/CB451] CPU-card PCMCIA port space
  51. 0xFC000000 - 0xFC0FFFFF CS1# [VDK] MB86943 config space
  52. 0xFC100000 - 0xFC1FFFFF CS6# [CB70/CB451] CPU-card DM9000 NIC space
  53. 0xFC100000 - 0xFC1FFFFF CS6# [PDK] AX88796 NIC space
  54. 0xFC200000 - 0xFC2FFFFF CS3# MB93493 CSR area (DAV daughter board)
  55. 0xFD000000 - 0xFDFFFFFF CS4# [CB70/CB451] CPU-card extra flash space
  56. 0xFE000000 - 0xFEFFFFFF Internal CPU peripherals
  57. 0xFF000000 - 0xFF1FFFFF CS0# Flash 1
  58. 0xFF200000 - 0xFF3FFFFF CS0# Flash 2
  59. 0xFFC00000 - 0xFFC0001F CS0# [VDK] FPGA
  60. The kernel reads the size of the SDRAM from the memory bus controller
  61. registers by default.
  62. The kernel initialisation code (1) adjusts the SDRAM base addresses to
  63. move the SDRAM to desired address, (2) moves the kernel image down to the
  64. bottom of SDRAM, (3) adjusts the bus controller registers to move I/O
  65. windows, and (4) rearranges the protection registers to protect all of
  66. this.
  67. The reasons for doing this are: (1) the page at address 0 should be
  68. inaccessible so that NULL pointer errors can be caught; and (2) the bottom
  69. three quarters are left unoccupied so that an FR-V CPU with an MMU can use
  70. it for virtual userspace mappings.
  71. See include/asm-frv/mem-layout.h for constants pertaining to the memory
  72. layout.
  73. See include/asm-frv/mb-regs.h for the constants pertaining to the I/O bus
  74. controller configuration.
  75. (*) uClinux Memory Protection
  76. A DAMPR register is used to cover the entire region used for I/O
  77. (0xE0000000 - 0xFFFFFFFF). This permits the kernel to make uncached
  78. accesses to this region. Userspace is not permitted to access it.
  79. The DAMPR/IAMPR protection registers not in use for any other purpose are
  80. tiled over the top of the SDRAM such that:
  81. (1) The core kernel image is covered by as small a tile as possible
  82. granting only the kernel access to the underlying data, whilst
  83. making sure no SDRAM is actually made unavailable by this approach.
  84. (2) All other tiles are arranged to permit userspace access to the rest
  85. of the SDRAM.
  86. Barring point (1), there is nothing to protect kernel data against
  87. userspace damage - but this is uClinux.
  88. (*) Exceptions and Fixups
  89. Since the FR40x and FR55x CPUs that do not have full MMUs generate
  90. imprecise data error exceptions, there are currently no automatic fixup
  91. services available in uClinux. This includes misaligned memory access
  92. fixups.
  93. Userspace EFAULT errors can be trapped by issuing a MEMBAR instruction and
  94. forcing the fault to happen there.
  95. On the FR451, however, data exceptions are mostly precise, and so
  96. exception fixup handling is implemented as normal.
  97. (*) Userspace Breakpoints
  98. The ptrace() system call supports the following userspace debugging
  99. features:
  100. (1) Hardware assisted single step.
  101. (2) Breakpoint via the FR-V "BREAK" instruction.
  102. (3) Breakpoint via the FR-V "TIRA GR0, #1" instruction.
  103. (4) Syscall entry/exit trap.
  104. Each of the above generates a SIGTRAP.
  105. (*) On-Chip Serial Ports
  106. The FR-V on-chip serial ports are made available as ttyS0 and ttyS1. Note
  107. that if the GDB stub is compiled in, ttyS1 will not actually be available
  108. as it will be being used for the GDB stub.
  109. These ports can be made by:
  110. mknod /dev/ttyS0 c 4 64
  111. mknod /dev/ttyS1 c 4 65
  112. (*) Maskable Interrupts
  113. Level 15 (Non-maskable) interrupts are dealt with by the GDB stub if
  114. present, and cause a panic if not. If the GDB stub is present, ttyS1's
  115. interrupts are rated at level 15.
  116. All other interrupts are distributed over the set of available priorities
  117. so that no IRQs are shared where possible. The arch interrupt handling
  118. routines attempt to disentangle the various sources available through the
  119. CPU's own multiplexor, and those on off-CPU peripherals.
  120. (*) Accessing PCI Devices
  121. Where PCI is available, care must be taken when dealing with drivers that
  122. access PCI devices. PCI devices present their data in little-endian form,
  123. but the CPU sees it in big-endian form. The macros in asm/io.h try to get
  124. this right, but may not under all circumstances...
  125. (*) Ax88796 Ethernet Driver
  126. The MB93093 PDK board has an Ax88796 ethernet chipset (an NE2000 clone). A
  127. driver has been written to deal specifically with this. The driver
  128. provides MII services for the card.
  129. The driver can be configured by running make xconfig, and going to:
  130. (*) Network device support
  131. - turn on "Network device support"
  132. (*) Ethernet (10 or 100Mbit)
  133. - turn on "Ethernet (10 or 100Mbit)"
  134. - turn on "AX88796 NE2000 compatible chipset"
  135. The driver can be found in:
  136. drivers/net/ax88796.c
  137. include/asm/ax88796.h
  138. (*) WorkRAM Driver
  139. This driver provides a character device that permits access to the WorkRAM
  140. that can be found on the FR451 CPU. Each page is accessible through a
  141. separate minor number, thereby permitting each page to have its own
  142. filesystem permissions set on the device file.
  143. The device files should be:
  144. mknod /dev/frv/workram0 c 240 0
  145. mknod /dev/frv/workram1 c 240 1
  146. mknod /dev/frv/workram2 c 240 2
  147. ...
  148. The driver will not permit the opening of any device file that does not
  149. correspond to at least a partial page of WorkRAM. So the first device file
  150. is the only one available on the FR451. If any other CPU is detected, none
  151. of the devices will be openable.
  152. The devices can be accessed with read, write and llseek, and can also be
  153. mmapped. If they're mmapped, they will only map at the appropriate
  154. 0x7e8nnnnn address on linux and at the 0xfe8nnnnn address on uClinux. If
  155. MAP_FIXED is not specified, the appropriate address will be chosen anyway.
  156. The mappings must be MAP_SHARED not MAP_PRIVATE, and must not be
  157. PROT_EXEC. They must also start at file offset 0, and must not be longer
  158. than one page in size.
  159. This driver can be configured by running make xconfig, and going to:
  160. (*) Character devices
  161. - turn on "Fujitsu FR-V CPU WorkRAM support"
  162. (*) Dynamic data cache write mode changing
  163. It is possible to view and to change the data cache's write mode through
  164. the /proc/sys/frv/cache-mode file while the kernel is running. There are
  165. two modes available:
  166. NAME MEANING
  167. ===== ==========================================
  168. wthru Data cache is in Write-Through mode
  169. wback Data cache is in Write-Back/Copy-Back mode
  170. To read the cache mode:
  171. # cat /proc/sys/frv/cache-mode
  172. wthru
  173. To change the cache mode:
  174. # echo wback >/proc/sys/frv/cache-mode
  175. # cat /proc/sys/frv/cache-mode
  176. wback
  177. (*) MMU Context IDs and Pinning
  178. On MMU Linux the CPU supports the concept of a context ID in its MMU to
  179. make it more efficient (TLB entries are labelled with a context ID to link
  180. them to specific tasks).
  181. Normally once a context ID is allocated, it will remain affixed to a task
  182. or CLONE_VM'd group of tasks for as long as it exists. However, since the
  183. kernel is capable of supporting more tasks than there are possible ID
  184. numbers, the kernel will pass context IDs from one task to another if
  185. there are insufficient available.
  186. The context ID currently in use by a task can be viewed in /proc:
  187. # grep CXNR /proc/1/status
  188. CXNR: 1
  189. Note that kernel threads do not have a userspace context, and so will not
  190. show a CXNR entry in that file.
  191. Under some circumstances, however, it is desirable to pin a context ID on
  192. a process such that the kernel won't pass it on. This can be done by
  193. writing the process ID of the target process to a special file:
  194. # echo 17 >/proc/sys/frv/pin-cxnr
  195. Reading from the file will then show the context ID pinned.
  196. # cat /proc/sys/frv/pin-cxnr
  197. 4
  198. The context ID will remain pinned as long as any process is using that
  199. context, i.e.: when the all the subscribing processes have exited or
  200. exec'd; or when an unpinning request happens:
  201. # echo 0 >/proc/sys/frv/pin-cxnr
  202. When there isn't a pinned context, the file shows -1:
  203. # cat /proc/sys/frv/pin-cxnr
  204. -1