Using Linuxbios to Liberate Embedded X86 Processors

Using Linuxbios to Liberate Embedded X86 Processors

Breaking the Chains—Using LinuxBIOS to Liberate Embedded x86 Processors Jordan H. Crouse Marc E. Jones Ronald G. Minnich Advanced Micro Devices, Inc. Advanced Micro Devices, Inc. Sandia National Labs [email protected] [email protected] Abstract systems have abandoned the BIOS hardware interfaces and access the hardware directly. The desktop computer While x86 processors are an attractive option for embed- focus of the traditional BIOS model frustrates embed- ded designs, many embedded developers avoid them be- ded systems designers and developers, who struggle to cause x86-based systems remain dependent on a legacy get a BIOS that embraces their unique platforms. Due to BIOS ROM to set up the system. LinuxBIOS is an the very specific requirements for system boot time and open source solution that replaces the proprietary BIOS resource usage, it is difficult to meet embedded stan- ROMs with a light-weight loader. LinuxBIOS frees the dards with a BIOS designed for two decades of desktop developer from complex CPU and chipset initialization computers. and allows a variety of payloads to be loaded, including The LinuxBIOS project exists to address legacy BIOS the Linux kernel itself. issues. It is licenced under the GNU Public License This presentation reviews the journey of the AMD (GPL) to promote a transparent and open loader. Lin- GeodeTM processors and chipset as they were integrated uxBIOS provides CPU and chipset initialization for x86, into LinuxBIOS to become the centerpoint of the One x86_64, and Alpha systems and allows the flexibility to Laptop Per Child (OLPC) project. We also discuss how load and run any number of different payloads. embedded developers can take advantage of the Lin- This paper discusses the development and use of Lin- uxBIOS environment for their own x86-based projects. uxBIOS for embedded x86 platforms based on AMD Geode processors. The first section examines the history 1 Introduction of LinuxBIOS and the AMD Geode processors. The next section moves into detail about the system initial- Ever since the x86 Personal Computer (PC) architec- ization process. The final section discusses integrating ture was introduced in 1981, it has been accompanied by payloads with the LinuxBIOS firmware. bootstrap code known as the Basic Input/Output System (BIOS) that executes a Power On Self Test (POST). Al- 2 History most every year since the PC’s introduction, hardware and operating system features have increased in com- “History is a guide to navigation in perilous plexity. Each new feature adds complexity to the BIOS, times. History is who we are and why we are which must maintain compatibility with older operating the way we are.” systems and yet also provide support for new ones. The —David C. McCullough end result is a convoluted and cryptic combination of old standards (such as software interrupts for accessing the 2.1 LinuxBIOS History display and storage devices) and new standards (such as Advanced Configuration and Power Interface (ACPI)). Ron Minnich started the LinuxBIOS project at Los Almost all BIOS implementations are proprietary and Alamos National Lab (LANL) in September 1999 to ad- many Open Source developers are in conflict with what dress problems caused by the PC BIOS in large clusters. is perceived to generally be a “black magic” box. Due to The team agreed that the ideal PC cluster node would the arcane nature of the BIOS, most modern operating have the following features: • 103 • 104 • Breaking the Chains—Using LinuxBIOS to Liberate Embedded x86 Processors • Boot directly into an OS from non-volatile RAM; GX processor based LinuxBIOS loader, originally uti- lizing a Linux-as-bootloader payload. This later tran- • Configure only the network interfaces; sitioned to OpenFirmware after it became available in the middle of 2006. In 2007, AMD Geode LX proces- • Connect to a control node using any working net- sor support was added to the loader, making it a freely work interface; available reference BIOS design for interested develop- ers of other AMD Geode solutions. • Take action only at the direction of the control node. 2.2 AMD Geode History R At that time, the LANL team felt that Linux did a bet- The AMD Geode processor is the offspring of the Me- ter job of running the hardware than the PC BIOS. Their diaGX processor released by Cyrix in 1997. The Medi- concept was to use a simple hardware bootstrap to load aGX saved total system cost by embedding a graphics a small Linux kernel from flash to memory. Leveraging engine that used one of the first Unified Memory Ar- work from the OpenBIOS project, the LinuxBIOS team chitecture (UMA) implementations. It also featured an booted an Intel L440GX+ motherboard after approxi- integrated northbridge memory controller and Sound- mately six months of development. Early on, the team Blaster emulation in the CPU. The MediaGX broke the decided that assembly code would not be the future of sub-$1000, sub-$500, and sub-$200 price barrier on the LinuxBIOS. OpenBIOS was disregarded because it was Compaq Presario 2100 in 1996 and 1997. In 1997, based on a great deal of assembly code and a difficult-to- Cyrix was purchased by National Semiconductor, who master build structure. The team found a simple loader renamed the MediaGX line to Geode. National Semi- from STMicroelectronics called STPC BIOS that was conductor released the Geode GX2 (today, just called written in C and available to be open sourced, so it be- the GX) and CS5535 companion chip in 2002. In 2003, 1 came the basis for the first version of LinuxBIOS. the Geode division was sold to AMD. AMD focused heavily on power, price, and performance, and in 2005 In 2000, Linux NetworX and Linux Labs joined the released the AMD Geode LX [email protected] processor and effort. The LinuxBIOS team added Symmetric Multi- CS5536 companion chip, with the LX [email protected] pro- ple Processor (SMP) support, an Alpha port, and cre- cessor following in 2007. ated the first 13-node LinuxBIOS-based Supercomput- ing Clusters. Since 2001, the team has added devel- The AMD Geode GX and LX processors support the opers and they continue to port to new platforms, in- i586 instruction set, along with MMX and 3DNow!TM TM TM cluding AMD Opteron processor- and AMD Athlon extensions. The LX features a 64K instruction and a processor-based platforms. Interestingly enough, Lin- 64K data L1 cache and 128K L2 cache. Both proces- uxBIOS was originally designed for clusters, yet Lin- sors have on-board 2D graphics and video accelerators. uxBIOS for non-cluster platforms far exceeds the clus- The LX adds an on-board AES engine and true random ter use. number generator. The CS5536 companion chip pro- vides southbridge capabilities: IDE, USB 2.0, SMBus, In 2005, some current and past members of the MIT Me- AC97, timers, GPIO pins, and legacy x86 peripherals. dia Lab joined together to create the One Laptop Per Child (OLPC) program, dedicated to making a low-cost laptop for educational projects around the globe. The 3 Geode LinuxBIOS ROM image OLPC team designed an x86 platform that incorporates an AMD Geode solution. As low price and open tech- While the entire image is known as LinuxBIOS, it is nology were part of the core requirements for the lap- constructed of individual pieces that work together. An top, the designers decided to use a royalty-free open AMD Geode LinuxBIOS ROM image is made up of 2 source BIOS solution, ultimately choosing LinuxBIOS. three main binary pieces: The first two board revisions included the AMD Geode TM • LinuxBIOS Loader: system initialization code; 1Version 2 started after the addition of Hypertransport technol- ogy support changed the device model enough to warrant a version 2OLPC also adds additional binary code for its embedded con- bump. troller. 2007 Linux Symposium, Volume One • 105 • VSA2: the AMD Geode proccessor’s System Man- linuxbios/src agement Interrupt (SMI) handler; |-- cpu |-- amd • Payload: the image or program to be loaded to boot |-- model_gx2 the OS. |-- model_lx 3.1 LinuxBIOS Architecture The mainboard/ directory contains platform-specific configuration and code. The platform Config.lb file contains the PCI device configuration and IRQ routing. LinuxBIOS version 2 is structured to support multiple This directory also contains the source file compiled by motherboards, CPUs, and chipsets. The overall plat- ROMCC. form configuration is described in Config.lb in the mainboard directory. The Config.lb file contains important information like what CPU architecture to linuxbios/src build for, what PCI devices and slots are present, and |-- mainboard where code should be addressed. The mainboard also |-- amd contains the pre-DRAM initialization file, auto.c. |-- norwich ROMCC compiles auto.c and generates a stackless |-- olpc assembly code file, auto.inc. The use of ROMCC |-- rev_a works well for small sections of simple C code, but for complicated memory controller initialization, there are (Note: ‘Norwich’ is the code name for an AMD Geode some issues with code size and C variable-to-register development platform). space conversion. The source code in northbridge/ includes memory To work around the ROMCC issues, Yinghai Lu of initialization and the PCI bridge 0 configuration and ini- AMD developed support for the AMD64 architecture’s tialization. In the AMD Geode processor’s architecture, Cache-as-RAM (CAR) feature [1]. Compiled C code the northbridge is integrated into the CPU, so the direc- makes heavy use of the stack. Only a few lines of assem- tory name is the same as the CPU. bly code are needed to set up the CPU cache controller to be used as temporary storage for the stack. All the pre-DRAM initialization (including memory initializa- linuxbios/src tion) is compiled as normal C code.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 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