Porting Linux to the M32R Processor

Porting Linux to the M32R Processor

Porting Linux to the M32R processor Hirokazu Takata Renesas Technology Corp., System Core Technology Div. 4-1, Mizuhara, Itami, Hyogo, 664-0005, Japan [email protected] Naoto Sugai, Hitoshi Yamamoto Mitsubishi Electric Corp., Information Technology R&D Center 5-1-1, Ofuna Kamakura, Kanagawa 247-8501, Japan fsugai,[email protected] Abstract ness, high performance, and low power dissipa- tion. So far, the M32R family microcomputers have widely used for the products in a variety of ¯elds| We have ported a Linux system to the Renesas1 for example, automobiles, digital still cameras, dig- M32R processor, which is a 32-bit RISC micropro- ital video camcorders, cellular phones, and so on. cessor designed for embedded systems, and with an on-chip-multiprocessor feature. Recently, the Linux system has begun to be used widely and employed even in the embedded systems. So far, both of UP (Uni-Processor) and SMP (Sym- The embedded systems would be more software- metrical Multi-Processor) kernels (based on 2.4.19) oriented systems hereafter. The more complex and have been ported and they are operating on the larger the embedded system is, the more compli- M32R processor. A Debian GNU/Linux based sys- cated the software becomes and harder to develop. tem has been also developed on a diskless NFS-root In order to build these kinds of embedded sys- environment, and more than 300 uno±cial .deb tems e±ciently, it will be more important to utilize packages have already been prepared for the M32R generic OSes such as Linux to develop software. target. This is the ¯rst Linux architecture port to the In this paper, we describe this new architecture M32R processor. This porting project, called a port in detail and explain the current status of the \Linux/M32R" project, has been active since 2000. Linux/M32R project. Its goal is to prepare a Linux platform for the M32R processor. At ¯rst, this Linux porting was just a feasibility study for the new M32R processor de- velopment, and it was started by only a few mem- 1 Introduction bers of the M32R development team. Then, this project has grown to a lateral project among Rene- sas Technology Corp., Renesas Solutions Corp., and A Linux platform for Renesas M32R processor has Mitsubishi Electric Corp. been newly developed. The Renesas M32R proces- sor is a 32-bit RISC microprocessor, which is de- In this feasibility study, we have ported not only signed for embedded systems. It is suitable for a Linux kernel, but also whole GNU/Linux system System-on-a-Chip (SoC) LSI due to its compact- including GNU tools, libraries, and other software packages, so called \userland." We also enhanced 1Renesas Technology Corp. is a new joint semiconductor the M32R processor to add MMU (Memory Man- company established by Hitachi Ltd. and Mitsubishi Electric agement Unit) facility in order to port Linux sys- Corp. on April 1, 2003. It would be the industry's largest microcontroller (MCU) supplier in the world. The M32R tem. And we have also developed an SMP ker- family microcontroller and its successor will be continuously nel to investigate multiprocessing by M32R's on- supplied by Renesas. chip-multiprocessor feature[1]. At present, the General Purpose Registers Control Registers Linux/M32R system can operate on the dual M32R 0 31 0 31 R0 CR0 (PSW) processor status word cores in SMP mode. R1 CR1 (CBR) condition bit register R2 CR2 (SPI) interrupt stack pointer In this paper, we describe this new architecture port R3 CR3 (SPU) user stack pointer R4 CR5 (EVB) EIT vector base register in detail and explain about the current status of the R5 CR6 (BPC) backup PC Linux/M32R project. R6 R7 Accumulators R8 R9 0 8 63 R10 A0 R11 A1 2 Linux/M32R Platform for Embed- R12 R13 Program Counter ded Systems R14 (link register) 0 31 R15 (stack pointer) PC Recently, due to the continuous evolution of semi- Figure 1: M32R register architecture conductor technologies, it is possible to integrate a whole system into one LSI chip, so called \System- on-a-Chip (SoC)." functional and higher performance system will be In an SoC, microprocessor core(s), peripheral I/O required. functions, internal memories, and user logics can be integrated into a single chip. In the development of embedded systems, it is important to tune system performance from both By making use of wide internal buses, an LSI can hardware and software points of view. There- achieve high performance which can not be realized fore, we used M32R softmacro and FPGA (Field by combination of several general-purpose LSIs. In Programmable Gate Array) devices to implement other words, we can optimize system performance an evaluation board for rapid system prototyping. and cost by using SoC, because we can employ op- FPGA devices are slow, but make it possible to de- timum hardware architecture and circuit con¯gura- velop a system in short turn-around time. tion. In this feasibility study, to construct a Linux plat- In such an SoC, a microprocessor core is a key form, we ported Linux to the M32R architecture, part; therefore, the more compact and higher perfor- and validated the hardware system architecture mance microprocessor is signi¯cantly required. To through the porting, and developed the software de- make such a high performance embedded processor velopment environment. core, not only in circuit and process technology but also architectural breakthrough is necessary. Espe- cially, multiprocessor technology is important even 2.1 M32R architecture for the embedded processor, because it can improve processor performance and lower system power dis- sipation by increasing processor number scalably The M32R is a 32-bit RISC microprocessor, and em- and without increasing operating clock frequency. ploys load-store architecture like other RISC proces- sors. Therefore, memory access is executed by only For an SoC with embedded microprocessor, software load and store instructions and logical and arith- is also a key point. The more system is highly func- metic operation is executed among registers. Except tional, the more software will be complex and there for multiply and divide instructions, most of instruc- is an increasing demand for shortening development tions can be executed in one clock, and instruction time of SoC. Under such circumstance, recently the completion does not depend on the the instruction Linux OS becomes to be adopted for embedded sys- issuing order (out-of-order completion). The M32R tems. Linux platform makes it easy to port applica- supports DSP operation instructions such as multi- tion programs developed on a PC/EWS to the tar- ply and accumulate instructions. get system. We believe that a full-featured Linux system will come into wide use in embedded sys- Figure 1 shows the M32R register architecture. The tems, because embedded systems will become more M32R has sixteen 32-bit general purpose registers (R0 » R15) and 56-bit accumulators for the multi- 3 Porting Linux to the M32R ply and accumulate operations. R14 is also used as a link register (LR) which keeps return address for a subroutine call. There are two stack pointer reg- The Linux system consists of not only the Linux isters, SPI (interrupt stack pointer) and SPU (user kernel, but also the GNU toolchain and libraries. stack pointer). The CPU core selects one of them as Of course, a target hardware environment is also a current stack pointer (R15; SP) by the SM (stack necessary to execute Linux. mode) bit of the PSW (processor status word). Therefore we had to accomplish the following tasks: 2.2 M32R softmacro ² Porting the Linux kernel The M32R softmacro is a compact microprocessor, ² Development of Linux/M32R platforms (M32R developed to integrate into a SoC. It is a full syn- FPGA board, etc.) thesizable Verilog-HDL model and it has an excel- lent feature that the core does not depend on a spe- ² Enhancement of the GNU toolchain ci¯c process technology. Due to a synchronous edge- triggered design, it has good a±nity to EDA tools. ² Porting libraries (GNU C library, etc.) This M32R softmacro is so compact that it can be ² Userland; preparing software packages mapped into one FPGA. Utilizing such an M32R softmacro, we developed software on a prototype hardware and co-designed hardware and software si- Actually, in the Linux/M32R development, these multaneously. tasks have developed concurrently. To port Linux to the M32R, some enhancement of the M32R softmacro core was needed; processor 3.1 Porting Kernel to the M32R mode (user mode and supervisor mode) was intro- duced and an MMU module was newly supported. In the Linux kernel, the architecture-dependent por- tion is clearly distinguished. Therefore, in case of a ² TLB (Translation Lookaside Bu®er): instruc- new architecture port, all you need to do is pre- tion/data TLBs are full-associative, 32-entries pare only architecture dependent code, which is far each, respectively. less than whole Linux code. In the M32R case, ² page size : 4kB/16kB/64kB (user page), 4MB include/asm-m32r/ and arch/m32r/ are needed. (large page) To be more precise, we can prepare the architecture- dependent portion in reference to the other architec- 2.3 Integrated debugging function and ture implementation. However, it has some di±cul- SDI ties in rewriting these portions: The integrated debugging function is a signi¯cant asm function : It was very di±cult to port some characteristic of the M32R family microcomputer. headers in which asm statement is extensively The M32R common debugging interface, called as used, because an insu±cient and inadequate SDI (Scalable Debug Interface), is utilized via ¯ve rewriting easily cause bugs which are very hard JTAG pins; the internal debug functions are con- to debug.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us