162306a36Sopenharmony_ci=======================
262306a36Sopenharmony_ciARM Linux 2.6 and upper
362306a36Sopenharmony_ci=======================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci    Please check <ftp://ftp.arm.linux.org.uk/pub/armlinux> for
662306a36Sopenharmony_ci    updates.
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciCompilation of kernel
962306a36Sopenharmony_ci---------------------
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci  In order to compile ARM Linux, you will need a compiler capable of
1262306a36Sopenharmony_ci  generating ARM ELF code with GNU extensions.  GCC 3.3 is known to be
1362306a36Sopenharmony_ci  a good compiler.  Fortunately, you needn't guess.  The kernel will report
1462306a36Sopenharmony_ci  an error if your compiler is a recognized offender.
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci  To build ARM Linux natively, you shouldn't have to alter the ARCH = line
1762306a36Sopenharmony_ci  in the top level Makefile.  However, if you don't have the ARM Linux ELF
1862306a36Sopenharmony_ci  tools installed as default, then you should change the CROSS_COMPILE
1962306a36Sopenharmony_ci  line as detailed below.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci  If you wish to cross-compile, then alter the following lines in the top
2262306a36Sopenharmony_ci  level make file::
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci    ARCH = <whatever>
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci  with::
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci    ARCH = arm
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci  and::
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci    CROSS_COMPILE=
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci  to::
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci    CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci  eg.::
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci    CROSS_COMPILE=arm-linux-
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci  Do a 'make config', followed by 'make Image' to build the kernel
4362306a36Sopenharmony_ci  (arch/arm/boot/Image).  A compressed image can be built by doing a
4462306a36Sopenharmony_ci  'make zImage' instead of 'make Image'.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciBug reports etc
4862306a36Sopenharmony_ci---------------
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci  Please send patches to the patch system.  For more information, see
5162306a36Sopenharmony_ci  http://www.arm.linux.org.uk/developer/patches/info.php Always include some
5262306a36Sopenharmony_ci  explanation as to what the patch does and why it is needed.
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci  Bug reports should be sent to linux-arm-kernel@lists.arm.linux.org.uk,
5562306a36Sopenharmony_ci  or submitted through the web form at
5662306a36Sopenharmony_ci  http://www.arm.linux.org.uk/developer/
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci  When sending bug reports, please ensure that they contain all relevant
5962306a36Sopenharmony_ci  information, eg. the kernel messages that were printed before/during
6062306a36Sopenharmony_ci  the problem, what you were doing, etc.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ciInclude files
6462306a36Sopenharmony_ci-------------
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci  Several new include directories have been created under include/asm-arm,
6762306a36Sopenharmony_ci  which are there to reduce the clutter in the top-level directory.  These
6862306a36Sopenharmony_ci  directories, and their purpose is listed below:
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci  ============= ==========================================================
7162306a36Sopenharmony_ci   `arch-*`	machine/platform specific header files
7262306a36Sopenharmony_ci   `hardware`	driver-internal ARM specific data structures/definitions
7362306a36Sopenharmony_ci   `mach`	descriptions of generic ARM to specific machine interfaces
7462306a36Sopenharmony_ci   `proc-*`	processor dependent header files (currently only two
7562306a36Sopenharmony_ci		categories)
7662306a36Sopenharmony_ci  ============= ==========================================================
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ciMachine/Platform support
8062306a36Sopenharmony_ci------------------------
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci  The ARM tree contains support for a lot of different machine types.  To
8362306a36Sopenharmony_ci  continue supporting these differences, it has become necessary to split
8462306a36Sopenharmony_ci  machine-specific parts by directory.  For this, the machine category is
8562306a36Sopenharmony_ci  used to select which directories and files get included (we will use
8662306a36Sopenharmony_ci  $(MACHINE) to refer to the category)
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci  To this end, we now have arch/arm/mach-$(MACHINE) directories which are
8962306a36Sopenharmony_ci  designed to house the non-driver files for a particular machine (eg, PCI,
9062306a36Sopenharmony_ci  memory management, architecture definitions etc).  For all future
9162306a36Sopenharmony_ci  machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach
9262306a36Sopenharmony_ci  directory.
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ciModules
9662306a36Sopenharmony_ci-------
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci  Although modularisation is supported (and required for the FP emulator),
9962306a36Sopenharmony_ci  each module on an ARM2/ARM250/ARM3 machine when is loaded will take
10062306a36Sopenharmony_ci  memory up to the next 32k boundary due to the size of the pages.
10162306a36Sopenharmony_ci  Therefore, is modularisation on these machines really worth it?
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci  However, ARM6 and up machines allow modules to take multiples of 4k, and
10462306a36Sopenharmony_ci  as such Acorn RiscPCs and other architectures using these processors can
10562306a36Sopenharmony_ci  make good use of modularisation.
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ciADFS Image files
10962306a36Sopenharmony_ci----------------
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci  You can access image files on your ADFS partitions by mounting the ADFS
11262306a36Sopenharmony_ci  partition, and then using the loopback device driver.  You must have
11362306a36Sopenharmony_ci  losetup installed.
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci  Please note that the PCEmulator DOS partitions have a partition table at
11662306a36Sopenharmony_ci  the start, and as such, you will have to give '-o offset' to losetup.
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ciRequest to developers
12062306a36Sopenharmony_ci---------------------
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci  When writing device drivers which include a separate assembler file, please
12362306a36Sopenharmony_ci  include it in with the C file, and not the arch/arm/lib directory.  This
12462306a36Sopenharmony_ci  allows the driver to be compiled as a loadable module without requiring
12562306a36Sopenharmony_ci  half the code to be compiled into the kernel image.
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_ci  In general, try to avoid using assembler unless it is really necessary.  It
12862306a36Sopenharmony_ci  makes drivers far less easy to port to other hardware.
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ciST506 hard drives
13262306a36Sopenharmony_ci-----------------
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci  The ST506 hard drive controllers seem to be working fine (if a little
13562306a36Sopenharmony_ci  slowly).  At the moment they will only work off the controllers on an
13662306a36Sopenharmony_ci  A4x0's motherboard, but for it to work off a Podule just requires
13762306a36Sopenharmony_ci  someone with a podule to add the addresses for the IRQ mask and the
13862306a36Sopenharmony_ci  HDC base to the source.
13962306a36Sopenharmony_ci
14062306a36Sopenharmony_ci  As of 31/3/96 it works with two drives (you should get the ADFS
14162306a36Sopenharmony_ci  `*configure` harddrive set to 2). I've got an internal 20MB and a great
14262306a36Sopenharmony_ci  big external 5.25" FH 64MB drive (who could ever want more :-) ).
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci  I've just got 240K/s off it (a dd with bs=128k); that's about half of what
14562306a36Sopenharmony_ci  RiscOS gets; but it's a heck of a lot better than the 50K/s I was getting
14662306a36Sopenharmony_ci  last week :-)
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci  Known bug: Drive data errors can cause a hang; including cases where
14962306a36Sopenharmony_ci  the controller has fixed the error using ECC. (Possibly ONLY
15062306a36Sopenharmony_ci  in that case...hmm).
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci1772 Floppy
15462306a36Sopenharmony_ci-----------
15562306a36Sopenharmony_ci  This also seems to work OK, but hasn't been stressed much lately.  It
15662306a36Sopenharmony_ci  hasn't got any code for disc change detection in there at the moment which
15762306a36Sopenharmony_ci  could be a bit of a problem!  Suggestions on the correct way to do this
15862306a36Sopenharmony_ci  are welcome.
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci`CONFIG_MACH_` and `CONFIG_ARCH_`
16262306a36Sopenharmony_ci---------------------------------
16362306a36Sopenharmony_ci  A change was made in 2003 to the macro names for new machines.
16462306a36Sopenharmony_ci  Historically, `CONFIG_ARCH_` was used for the bonafide architecture,
16562306a36Sopenharmony_ci  e.g. SA1100, as well as implementations of the architecture,
16662306a36Sopenharmony_ci  e.g. Assabet.  It was decided to change the implementation macros
16762306a36Sopenharmony_ci  to read `CONFIG_MACH_` for clarity.  Moreover, a retroactive fixup has
16862306a36Sopenharmony_ci  not been made because it would complicate patching.
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci  Previous registrations may be found online.
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci    <http://www.arm.linux.org.uk/developer/machines/>
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ciKernel entry (head.S)
17562306a36Sopenharmony_ci---------------------
17662306a36Sopenharmony_ci  The initial entry into the kernel is via head.S, which uses machine
17762306a36Sopenharmony_ci  independent code.  The machine is selected by the value of 'r1' on
17862306a36Sopenharmony_ci  entry, which must be kept unique.
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci  Due to the large number of machines which the ARM port of Linux provides
18162306a36Sopenharmony_ci  for, we have a method to manage this which ensures that we don't end up
18262306a36Sopenharmony_ci  duplicating large amounts of code.
18362306a36Sopenharmony_ci
18462306a36Sopenharmony_ci  We group machine (or platform) support code into machine classes.  A
18562306a36Sopenharmony_ci  class typically based around one or more system on a chip devices, and
18662306a36Sopenharmony_ci  acts as a natural container around the actual implementations.  These
18762306a36Sopenharmony_ci  classes are given directories - arch/arm/mach-<class> - which contain
18862306a36Sopenharmony_ci  the source files and include/mach/ to support the machine class.
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci  For example, the SA1100 class is based upon the SA1100 and SA1110 SoC
19162306a36Sopenharmony_ci  devices, and contains the code to support the way the on-board and off-
19262306a36Sopenharmony_ci  board devices are used, or the device is setup, and provides that
19362306a36Sopenharmony_ci  machine specific "personality."
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci  For platforms that support device tree (DT), the machine selection is
19662306a36Sopenharmony_ci  controlled at runtime by passing the device tree blob to the kernel.  At
19762306a36Sopenharmony_ci  compile-time, support for the machine type must be selected.  This allows for
19862306a36Sopenharmony_ci  a single multiplatform kernel build to be used for several machine types.
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci  For platforms that do not use device tree, this machine selection is
20162306a36Sopenharmony_ci  controlled by the machine type ID, which acts both as a run-time and a
20262306a36Sopenharmony_ci  compile-time code selection method.  You can register a new machine via the
20362306a36Sopenharmony_ci  web site at:
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci    <http://www.arm.linux.org.uk/developer/machines/>
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci  Note: Please do not register a machine type for DT-only platforms.  If your
20862306a36Sopenharmony_ci  platform is DT-only, you do not need a registered machine type.
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci---
21162306a36Sopenharmony_ci
21262306a36Sopenharmony_ciRussell King (15/03/2004)
213