0% found this document useful (0 votes)
28 views14 pages

ARCLinux GettingStarted

ARCLinux_GettingStarted

Uploaded by

Dennis Cheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views14 pages

ARCLinux GettingStarted

ARCLinux_GettingStarted

Uploaded by

Dennis Cheng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Linux for

DesignWare®
ARC®
Getting Started
Version 5977-007 August 2011
Linux for DesignWare ARC Getting Started
Synopsys, Inc.
Copyright Notice and Proprietary Information
Copyright © 2011 Synopsys, Inc. All rights reserved. This software and documentation contain confidential and
proprietary information that is the property of Synopsys, Inc. The software and documentation are furnished
under a license agreement and may be used or copied only in accordance with the terms of the license
agreement. No part of the software and documentation may be reproduced, transmitted, or translated, in any
form or by any means, electronic, mechanical, manual, optical, or otherwise, without prior written permission of
Synopsys, Inc., or as expressly provided by the license agreement.
Destination Control Statement
All technical data contained in this publication is subject to the export control laws of the United States of
America. Disclosure to nationals of other countries contrary to United States law is prohibited. It is the reader’s
responsibility to determine the applicable regulations and to comply with them.
Disclaimer
SYNOPSYS, INC., AND ITS LICENSORS MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Registered Trademarks (®)
Synopsys, AEON, AMPS, Astro, Behavior Extracting Synthesis Technology, Cadabra, CATS, Certify, CHIPit,
CoMET, Confirma, CODE V, Design Compiler, DesignWare, EMBED-IT!, Formality, Galaxy Custom Designer,
Global Synthesis, HAPS, HapsTrak, HDL Analyst, HSIM, HSPICE, Identify, Leda, LightTools, MAST, METeor,
ModelTools, NanoSim, NOVeA, OpenVera, ORA, PathMill, Physical Compiler, PrimeTime, SCOPE, Simply
Better Results, SiVL, SNUG, SolvNet, Sonic Focus, STAR Memory System, Syndicated, Synplicity, the
Synplicity logo, Synplify, Synplify Pro, Synthesis Constraints Optimization Environment, TetraMAX, UMRBus,
VCS, Vera, and YIELDirector are registered trademarks of Synopsys, Inc.
Trademarks (™)
AFGen, Apollo, ARC, ASAP, Astro-Rail, Astro-Xtalk, Aurora, AvanWaves, BEST, Columbia, Columbia-CE,
Cosmos, CosmosLE, CosmosScope, CRITIC, CustomExplorer, CustomSim, DC Expert, DC Professional, DC
Ultra, Design Analyzer, Design Vision, DesignerHDL, DesignPower, DFTMAX, Direct Silicon Access, Discovery,
Eclypse, Encore, EPIC, Galaxy, HANEX, HDL Compiler, Hercules, Hierarchical Optimization Technology, High-
performance ASIC Prototyping System, HSIMplus, i-Virtual Stepper, IICE, in-Sync, iN-Tandem, Intelli, Jupiter,
Jupiter-DP, JupiterXT, JupiterXT-ASIC, Liberty, Libra-Passport, Library Compiler, Macro-PLUS, Magellan, Mars,
Mars-Rail, Mars-Xtalk, Milkyway, ModelSource, Module Compiler, MultiPoint, ORAengineering, Physical Analyst,
Planet, Planet-PL, Polaris, Power Compiler, Raphael, RippledMixer, Saturn, Scirocco, Scirocco-i, SiWare, Star-
RCXT, Star-SimXT, StarRC, System Compiler, System Designer, Taurus, TotalRecall, TSUPREM-4, VCSi,
VHDL Compiler, VMC, and Worksheet Buffer are trademarks of Synopsys, Inc.
Service Marks (sm) MAP-in, SVP Café, and TAP-in are service marks of Synopsys, Inc.
SystemC is a trademark of the Open SystemC Initiative and is used under license.
ARM and AMBA are registered trademarks of ARM Limited.
Saber is a registered trademark of SabreMark Limited Partnership and is used under license.
PCI Express is a trademark of PCI-SIG.
All other product or company names may be trademarks of their respective owners.
Synopsys, Inc.
700 E. Middlefield Road
Mountain View, CA 94043
[Link]

i Synopsys, Inc. August 2011


Contents
Customer Support ...................................................................................................... 1
Accessing SolvNet ................................................................................................. 1
Contacting the Synopsys Technical Support Center .............................................. 1
1 About this Document ............................................................................................... 2
Document Overview ............................................................................................... 2
Typographical Conventions .................................................................................... 2
2 Building Linux for DesignWare ARC ........................................................................ 4
Installation and Build Overview .............................................................................. 4
Prerequisites .......................................................................................................... 4
Preparing Initramfs Before Building ........................................................................ 4
Building the Kernel ................................................................................................. 5
3 Running Linux for DesignWare ARC ....................................................................... 7
Running ARC Linux on Hardware (AA4 Board) ...................................................... 7
Running ARC Linux on the Instruction-Set Simulator ............................................. 8
4 Building BusyBox for ARC ....................................................................................... 9
5 Using an NFS-Based Workflow ............................................................................. 10
6 Troubleshooting ..................................................................................................... 11

August 2011 Synopsys, Inc. ii


Customer Support

Customer support is available through SolvNet online customer support and through
contacting the Synopsys Technical Support Center.

Accessing SolvNet
SolvNet includes an electronic knowledge base of technical articles and answers to
frequently asked questions about Synopsys tools. SolvNet also gives you access to
a wide range of Synopsys online services, which include downloading software,
viewing Documentation on the Web, and entering a call to the Support Center.
To access SolvNet:
1. Go to the SolvNet Web page at [Link]
2. If prompted, enter your user name and password. (If you do not have a
Synopsys user name and password, follow the instructions to register
with SolvNet.)
If you need help using SolvNet, click SolvNet Help in the Support Resources section.

Contacting the Synopsys Technical Support Center


If you have problems, questions, or suggestions, you can contact the Synopsys
Technical Support Center in the following ways:
Open a call to your local support center from the Web by going to
[Link] (Synopsys user name and password
required), then clicking “Enter a Call to the Support Center.”
Send an e-mail message to your local support center.
o E-mail support_center@[Link] from within North America.
o Find other local support center e-mail addresses at
[Link]
Telephone your local support center.
o Call (800) 245-8005 from within the continental United States.
o Call (650) 584-4200 from Canada.
o Find other local support center telephone numbers at
[Link]

1 Synopsys, Inc. August 2011


1
About this Document

Document Overview
This document describes how to get up and running with ARC Linux. It
covers the following topics.
Preparing the shipped initramfs for kernel build
See Preparing Initramfs Before Build.
Building the ARC Linux kernel
See Building the Kernel.
Running ARC Linux on hardware (AA4 FPGA Reference Board)
See Running ARC Linux on Hardware (AA4 Board).
Running ARC Linux on the MetaWare Debugger’s Instruction Set
Simulator (ISS)
See Running ARC Linux on the Instruction-Set Simulator.
Building or rebuilding your own version of BusyBox for ARC
See Building BusyBox for ARC.
NFS-Based workflow
See Using an NFS-Based Workflow.
Troubleshooting
See Troubleshooting.

Typographical Conventions
This document uses the following typographical conventions:

Convention Meaning Examples


bold Functions get_callback()
predefined the simple_initiator_socket
classes class
values to be template
entered >

August 2011 Synopsys, Inc. 2


Typographical Conventions Linux for DesignWare® ARC®

Convention Meaning Examples


literally Select Save All.
GUI elements
text to be replaced
with your own
sc_time
values
code in general

3 Synopsys, Inc. August 2011


2
Building Linux for DesignWare ARC

Installation and Build Overview


A minimal Linux environment requires a kernel with a root file system
containing the init program, shell, inetd and utilities such as , , etc.
The ARC Linux distribution ships with kernel sources, a pre-built binary
initramfs (BusyBox based) that serves as the initial root file system, and the
uboot bootloader.

Prerequisites
The ARC GNU tools must be installed before attempting kernel builds.
Installation is described in the readme files that accompany ARC GNU.
Ensure the environment variable points to both the elf32 compiler
for kernel builds and the uClibc compiler used for application builds.
Assuming as your shell, issue a command such as the following:

Preparing Initramfs Before Building


The initramfs you receive is preloaded with the following:
Startup scripts:
Configuration scripts:
Target system libraries:
Cross-compiled BusyBox binary, which provides the functionality of
commonly used Unix utilities such as , , , , etc.,
including the program. The initramfs you receive includes both
statically and dynamically linked versions with the dynamically linked
version as the default (using symbolic links).
Other cross-compiled utilities such as , , ,
,
The initramfs you receive lacks the device nodes, typically mounted at
in a running Linux system, since creating, packaging, and unpacking

August 2011 Synopsys, Inc. 4


Building the Kernel Linux for DesignWare® ARC®

them requires superuser or sudo privileges. You can create them using a
helper script in the untarred initramfs:

Additionally, you can put whatever you please (scripts, cross-compiled


binaries) in the initramfs to be made accessible at run time on the target.

Building the Kernel


1. Configure the kernel:

Because the kernel source tree contains code for multiple architectures,
you need to provide with information to build ARC as an architecture-
specific component, using the variable . Specify this variable for all the
build commands; as a shortcut, you can set a shell alias or export as
an environment variable.
The defconfig target generates a kernel build configuration file
based on .
You can further modify the default configuration using or
targets.
2. Optionally adjust the initramfs folder path in .
Kernel build needs the exact path (absolute or relative) of the untarred
initramfs folder (see Preparing Initramfs Before Building). This information
is specified in kernel file with option .
By default its value is , which works out-of-the-box if
both the kernel and initramfs folders are at the same level in the directory
hierarchy. If not, change it to reflect the path on your system.
Note
If this initramfs path is a symbolic link, make sure a trailing '/' is appened to it:

3. Build the kernel with the following command:

It is not necessary to specify target as in previous ARC Linux


releases.

5 Synopsys, Inc. August 2011


Linux for DesignWare® ARC® Building the Kernel

The resulting file is a fully contained Linux image that is ready to


run on a simulator or an ARCangel target.

August 2011 Synopsys, Inc. 6


3
Running Linux for DesignWare ARC

This section describes running Linux for DesignWare ARC on hardware or


instruction-set simulator.

Running ARC Linux on Hardware (AA4 Board)


This section describes how to run ARC Linux on the FPGA-based
ARCangel 4 (AA4) board using the MetaWare debugger and Ashling
Opella XD connector (over JTAG) – assuming Microsoft Windows as host.
In addition to the vmlinx binary, you also need an FPGA bitfile (XBF)
containing ARC 700 and other hardware IP blocks to program the FPGA.
Start the debugger with the following command line:

This command line starts the MetaWare debugger in GUI mode and blasts
the FPGA with the bitfile, then downloads the kernel ELF file to the target.
Click Run, and the kernel will start booting.
To view the Linux console, connect the host to the ARCangel via serial port.
Configure the host serial port as follows:

7 Synopsys, Ic. August 2011


Linux for DesignWare® ARC® Running ARC Linux on the Instruction-Set Simulator

Running ARC Linux on the Instruction-Set Simulator


ARC Linux can also be run on the MetaWare debugger instruction-set
simulator (ISS). This way you can experiment with Linux without the need
for ARC hardware or FPGA implementations. The ISS not only emulates
the ARC ISA (and CPU micro-architecture such as caches and MMU); it
can also emulate some of the essential peripherals such as UART, frame
buffer, and Ethernet (Windows only). This makes the Linux experience very
realistic even though it is simulated: You can type shell commands on the
console, start new programs, and see their output in real time. It also
provides a very convenient environment to debug the kernel itself by
providing a slower system with features such as instruction tracing and
profiling.
The kernel binary built for real peripherals on AA4 also works in the ISS, as
corresponding device drivers detect where they are executing and abort
the device initialization if executing on the ISS instead of real hardware.
To emulate an ARC 700 4.9-based system, launch the debugger with the
following command line:

To emulate an ARC 700 4.10-based system, add the following:

August 2011 Synopsys, Inc. 8


4
Building BusyBox for ARC

ARC Linux releases up to and including 1.3 shipped a verified version of


BusyBox as part of the distribution – as patched sources. With ARC Linux
Release 1.4 that is no longer required. Any relatively recent upstream
version will build out-of-the-box for ARC. ARC Linux does include a pre-
built, binary-only BusyBox as part of the initramfs for ease of use.
To build your own version of BusyBox, do the following:
1. Issue the following commands:

2. Copy the resulting binary into initramfs:

3. Rebuild the kernel with the updated initramfs.

9 Synopsys, Inc. August 2011


5
Using an NFS-Based Workflow

While initramfs serves as a good starting point for a working ARC Linux
system, it quickly becomes a major inconvenience in an iterative develop-
test-debug workflow, as it involves developing, copying-to-ramfs, kernel-
rebuild, kernel-reboot. Application development must not require a kernel
rebuild or especially a reboot. Ideally users want to develop on target itself,
but given the embedded nature of ARC Linux deployment and the lack of
target resources (processing power, applications), the next-best option is to
develop on the host and be able to access that development environment
on target in real time. You can do this by using NFS protocol-based remote
access (by default, NFS client is already enabled in the ARC Linux kernel).
Details might vary by distribution, but if you have NFS-shared one or more
host folders, you can mount the same folders on target as follows:

As a next step, you can completely eliminate initramfs by having an NFS-


based root file system. To do so, enable the option in
the kernel and specify the of the host that serves the root
file system as part of the kernel command line.

August 2011 Synopsys, Inc. 10


6
Troubleshooting

Following are some of the common pitfalls when trying to start the system
for the first time.
Problem: Linux Fails to Boot to the Shell Prompt
The CPU configuration (real or simulated) doesn't match the kernel
configuration (the kernel generally can report the exact cause of this
mismatch, primarily due to ).
Possible Causes
Cache-line size
MMU page size
MMU version
Absence of real peripherals (IDE or frame buffer) which a kernel built
with the corresponding driver tries to initialize
Clock frequency of the board as configured with MetaWare debugger
using does not match kernel configuration option
.
On the ISS, the kernel might not boot if one of the following toggles is
on in the MetaWare debugger:
o
o
o
o
You can turn them off using trace_throw, for example.
Problem: Garbled Output in Serial Console
Possible Cause
The baud rate of the UART does not match kernel configuration option
.

11 Synopsys, Inc. August 2011

Common questions

Powered by AI

An NFS-based workflow in ARC Linux provides significant advantages by facilitating development without the need for repetitive kernel rebuilds and reboots. It enables dynamic access to host development environments and resources in real time on the target system . This approach aligns better with typical development workflows as it alleviates constraints associated with limited embedded system resources and processing power, allowing more agile testing and development cycles. By using NFS, developers can route around the limitations of initramfs, such as its static nature and longer debug cycles, focusing instead on leveraging network resources directly from the development machine . Ultimately, it streamlines application development and testing processes by reducing dependencies on the embedded system's local resources.

Building a Linux kernel for DesignWare ARC involves several key steps. Firstly, the ARC GNU tools must be installed, and the PATH environment variable should include paths to the elf32 and uClibc compilers used for kernel and application builds respectively . Next, the initial root file system is prepared using a pre-built binary initramfs that includes basic utilities and startup scripts . Before building, device nodes within the initramfs need to be created using a provided script, requiring superuser privileges . The kernel is configured using commands such as make ARCH=arc defconfig, which builds a configuration specific to ARC architecture . The file .config in the kernel source specifies the path to the initramfs, and if necessary, this path should be adjusted to ensure kernel build completeness . The kernel build is then completed with the command make ARCH=arc, resulting in a vmlinux file ready for simulation or deployment on an ARC board .

Running ARC Linux on hardware, such as the AA4 Board, involves using real physical connections and peripherals, starting the MetaWare debugger, and ensuring configurations such as FPGA bitfiles and JTAG frequencies are correctly set . The primary benefit is testing with actual hardware constraints and performance metrics . Conversely, the Instruction-Set Simulator (ISS) allows ARC Linux to run in a simulated environment that emulates ARC CPU instructions and micro-architecture, as well as emulating peripherals like UART and Ethernet . This method offers a controlled environment ideal for debugging and development, rendering it more flexible for testing changes without deploying to physical hardware . Each method benefits specific stages of development, with hardware tests providing real-world verification and ISS offering convenience and precision in iterative development.

Handling initramfs preloading is critical as it prepares the initial root file system for kernel operations . The document recommends ensuring that initramfs is preloaded with essential scripts and utilities like /etc/init.d/rcS, configuration scripts, and cross-compiled BusyBox binaries . These components provide the necessary environment for system startup and management. Additionally, because initramfs lacks device nodes by default, a helper script must be executed to create these . This preparation ensures that the kernel has a fully functional root environment upon boot, fundamental to initializing system operations and supporting further development and testing processes effectively.

SolvNet serves as an online customer support platform for Synopsys users, providing access to a large database of technical articles and frequently asked questions concerning Synopsys tools . It also hosts a range of online services such as software downloading, documentation viewing, and the ability to enter support calls directly through its interface . Users can access SolvNet by visiting its webpage and entering their Synopsys user credentials . The platform enhances support structure by offering a centralized resource for resolving issues and finding solutions efficiently, easing the user experience with comprehensive support services.

To execute Linux on an ARCangel 4 (AA4) board, the MetaWare debugger is used, starting with a specific command line setup . This involves commands like mdb -gui -OKN -nogoifmain enabling GUI mode and defining configurations such as jtag_frequency, gclk, and the FPGA bitfile for proper system setup . The bitfile will contain ARC 700 and necessary hardware IP blocks, crucial for programming the FPGA . Upon configuring these components, the debugger also runs the vmlinux kernel binary. To interact with the Linux console, a serial connection should be established with the specified host serial port settings . Proper configuration of these various elements, from hardware programming files to debugger settings, is essential for a successful boot and operational debugging session on real hardware.

To build BusyBox for ARC, developers need a recent upstream version of BusyBox, as these versions can be built out-of-the-box for ARC without additional patches . The process involves cloning the BusyBox repository and compiling it using ARC-specific tools with commands like git clone and make CROSS_COMPILE=arc-linux-uclibc-; after which, the resulting binary is installed and copied to the initramfs . Developers can then rebuild the kernel with the updated initramfs to integrate BusyBox into their ARC Linux environment. Incorporating this process into development workflows ensures that they are using the most recent and functional versions of BusyBox utilities, which are crucial for managing interactions and processes within Linux systems . Enhancing workflows with BusyBox also offers streamlined utilities for system initialization and runtime management, aiding overall software development and debugging efforts.

The document cites resolving discrepancies between CPU configurations and kernel settings as crucial to successful booting. One must ensure configuration settings such as cache-line sizes, MMU specifications, and peripheral presence match between the hardware/simulation environment and kernel settings . If configurations do not align, literals in the kernel, such as CONFIG_EARLYPRINTK, can be used to diagnose mismatches by reviewing the output for error reports . Adjustments to these configurations should be synchronized between the MetaWare debugger and the kernel settings within .config to resolve such issues. Additionally, toggles in the simulation environment that disrupt normal operations, like trace_throw, may need adjustment . Precise configuration ensures that all computational and memory handling mechanisms are compatible for smooth operation.

While configuring the ARC kernel build, defining the path to the initramfs within the .config file is essential . The CONFIG_INITRAMFS_SOURCE entry specifies the location of the initramfs folder, and the path should be correct to ensure proper inclusion during the kernel building process . If the initramfs is located relatively or involves symbolic links, these paths require precise definition and might necessitate a trailing '/' as part of the path to avoid configuration errors . Additionally, ensuring the initramfs contains necessary scripts and binaries, such as startup scripts and utilities documented earlier in the process, is crucial for it to serve effectively as a root file system for the kernel . Missing or incorrect configurations can lead to build failures or runtime issues, highlighting the importance of careful configuration setup and verification throughout the build process.

Common troubleshooting issues when starting ARC Linux include failing to boot to the shell prompt or experiencing garbled output on the serial console . These problems can originate from mismatches in CPU configuration and kernel settings, such as cache-line size, MMU page size, or clock frequency discrepancies . To resolve these, one may need to ensure configuration settings in the MetaWare debugger and the kernel are consistent. Additionally, disabling certain toggles in the debugger, such as trace_throw or enable_exceptions, can prevent issues from arising in simulated environments . For serial console output issues, ensuring the UART's baud rate aligns with the kernel configuration can correct communication errors . Thoroughly checking all hardware and software configurations before startup is essential to preemptively address these common issues.

You might also like