
Implementation of a Linux Workstation Based on The LEON Processor Marcus Hellqvist Master’s Thesis Electrical Engineering Program CHALMERS UNIVERSITY OF TECHNOLOGY Departement of Computer Science and Engineering Division of Computer Engineering Gothenburg 2005 All rights reserved. This publication is protected by law in accordance with “Lagen om Upphovs- rätt, 1960:729”. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or oth- erwise, without the prior permission of the authors. All products and names used in this thesis work are registered trademarks of their own respective corporation. Marcus Hellqvist, Gothenburg 2005 Abstract The implementation of a Linux workstation based on the LEON processor is described in this report. The workstation is implemented on a FPGA board as a System on Chip (SOC) design with Linux as operating system. In the frame of this project have a PS/2 keyboard interface and a text- based VGA controller with AMBA interfaces been developed as IP cores in VHDL. Linux device drivers for kernel 2.0 and 2.6 have been written for these two IP cores. A stand alone solution for the workstation is presented with the LEON3 SPARC V8 processor, the PS/2 IP core, the VGA IP core and additional cores from GRLIB IP library provided by Gaisler Research AB. Sammanfattning I denna rapport beskrivs implementation av en Linux arbetsstation baserad på LEON processorn. Arbetsstationen har implementerats som en System on Chip (SOC) design på ett FPGA-kort med Linux som operativsystem. Inom ramarna för projektet har två IP-block med AMBA interface utvecklats i VHDL, ett PS/2 interface för tangentbordshantering och en textbaserad VGA control- ler. Till dessa två IP-block har drivrutiner för Linux kernel 2.0 och 2.6 skrivits. Rapporten beskriver implementationen av en fristående arbetsstation med Linux som operativsys- tem. Arbetsstationens består av processorn LEON SPARC V8, ett IP-block för PS/2 tangentbord, ett IP-block med en textbaserad VGA controller samt ytterligare IP-block från IP-biblioteket GRLIB, tillhandahållet av Gaisler Research AB. Acknowledgement I would like to thank my supervisor Jiri Gaisler for his support and giving me the opportunity to do my master’s thesis at Gaisler Research AB. Thanks to all of the other staff at Gaisler Research for their help and special thanks to Konrad Eisele for his support with the Linux device drivers. Further on would I like to thank Lars Bengtsson at the department of Computer Engineering at Chalmers for undertaking this master’s thesis. Marcus Hellqvist Gothenburg July, 2005 1 Introduction .............................................................................................................1 2 Overview of the design environment.......................................................................2 2.1 GRLIB .................................................................................................................................2 2.2 LEON3.................................................................................................................................2 2.3 AMBA..................................................................................................................................2 2.3.1 AHB on-chip bus...................................................................................................2 2.3.2 APB on-chip bus....................................................................................................3 2.4 The two-process model........................................................................................................5 2.5 The GR-XC3S-1500 LEON FPGA Development board.....................................................6 3 Design of a PS/2 keyboard with APB interface.......................................................7 3.1 General description..............................................................................................................7 3.2 Communication....................................................................................................................7 3.2.1 Device to host communication ..............................................................................8 3.2.2 Host to device communication ..............................................................................8 4 Design of a text based VGA controller with APB interface..................................10 4.1 General description............................................................................................................10 4.2 Video timing ......................................................................................................................10 4.3 Video out hardware............................................................................................................12 5 Video Memory.......................................................................................................13 5.1 Dual port block RAM ........................................................................................................13 5.2 Scrolling.............................................................................................................................14 6 Character ROM......................................................................................................16 6.1 Component declaration......................................................................................................16 7 Linux device drivers ..............................................................................................17 8 Summary................................................................................................................19 9 References .............................................................................................................20 Appendix A Scan codes....................................................................................................21 Appendix B Keyboard commands ...................................................................................23 Appendix C User's Manual..............................................................................................25 C.1 APBPS2 - PS/2 keyboard with APB interface...................................................................25 C.2 APBVGA - VGA controller with APB interface...............................................................30 Appendix D VHDL code..................................................................................................34 Appendix E Keymap table ...............................................................................................46 1 Introduction Gaisler Research developes and supports the LEON SPARC V8 processor, a synthesisable proces- sor core for embedded applications. It is of interest to implement a LEON based Linux worksta- tion to demonstrate the capabilities of the processor. This master’s thesis project consist of developing a LEON based linux workstation. The workstation is based on the LEON3 processor with MMU and additional cores from the GRLIB IP (Intellectual Property) library developed by Gaisler Research. The complete workstation is realized as a System on Chip (SOC) design and implemented on a single Field Programmable Gate Array (FPGA). In the frame of this project a PS/2 keyboard interface and a text-based VGA controller have been developed in VHDL. This master thesis have been done in three phases: definition, implementation and testing. During the definition phase was the overall configuration of the system defined. Specifications for the PS/2 and VGA core were written. The implementation phase consisted of two parts: hardware development and software integration. The VGA controller and the PS/2 interface were developed in VHDL and simulated using the Modelsim simulator. They were then implemented to a LEON multiprocessor design and the com- plete SOC design was simulated and verified in a board level VHDL model. After verification of the whole system it was implemented on a FPGA board, correct operation of the hardware was tested using the GRMON debug monitor developed by Gaisler Research. When the functionality had been validated, device drivers for the Linux operating system kernel 2.0 and 2.6.11 were writ- ten for the VGA controller and the PS/2 interface. The Linux operating system including the two new drivers were then installed on the FPGA board. A special version of Linux for embedded applications was available in form of Snapgear Embedded Linux [1]. In the testing phase was the system booted up with the two different Linux kernels. This report describes the work with putting the workstation together, chapter two declare the design environment with a short presentation of the LEON3 processor and the bus architecture of the SOC design among others. Chapter three describes the functionality of the PS/2 IP core. The functionality of the VGA IP core can be found in chapter four and the video memory used by it in chapter five. Chapter six describes how a ROM containing the text font in use is used by the VGA controller. Finally is the Linux device drivers written for the PS/2 interface and the VGA controller described in chapter seven. 1 2 Overview of the design environment 2.1 GRLIB The GRLIB IP-library is developed for SOC designs and is a set of reusable IP-cores [2]. The IP- cores are bus-centric around the AMBA AHB bus and uses a coherent method for simulation and synthesis. The library
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages60 Page
-
File Size-