Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) ARM Linux 2.6 and upper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)     Please check <ftp://ftp.arm.linux.org.uk/pub/armlinux> for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)     updates.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) Compilation of kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)   In order to compile ARM Linux, you will need a compiler capable of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)   generating ARM ELF code with GNU extensions.  GCC 3.3 is known to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)   a good compiler.  Fortunately, you needn't guess.  The kernel will report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)   an error if your compiler is a recognized offender.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)   To build ARM Linux natively, you shouldn't have to alter the ARCH = line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)   in the top level Makefile.  However, if you don't have the ARM Linux ELF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)   tools installed as default, then you should change the CROSS_COMPILE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)   line as detailed below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)   If you wish to cross-compile, then alter the following lines in the top
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)   level make file::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)     ARCH = <whatever>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)   with::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)     ARCH = arm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)   and::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)     CROSS_COMPILE=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)   to::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)     CROSS_COMPILE=<your-path-to-your-compiler-without-gcc>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)   eg.::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)     CROSS_COMPILE=arm-linux-
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)   Do a 'make config', followed by 'make Image' to build the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)   (arch/arm/boot/Image).  A compressed image can be built by doing a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)   'make zImage' instead of 'make Image'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) Bug reports etc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) ---------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)   Please send patches to the patch system.  For more information, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)   http://www.arm.linux.org.uk/developer/patches/info.php Always include some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)   explanation as to what the patch does and why it is needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)   Bug reports should be sent to linux-arm-kernel@lists.arm.linux.org.uk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)   or submitted through the web form at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)   http://www.arm.linux.org.uk/developer/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)   When sending bug reports, please ensure that they contain all relevant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)   information, eg. the kernel messages that were printed before/during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)   the problem, what you were doing, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) Include files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)   Several new include directories have been created under include/asm-arm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)   which are there to reduce the clutter in the top-level directory.  These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)   directories, and their purpose is listed below:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)   ============= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)    `arch-*`	machine/platform specific header files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)    `hardware`	driver-internal ARM specific data structures/definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)    `mach`	descriptions of generic ARM to specific machine interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)    `proc-*`	processor dependent header files (currently only two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		categories)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)   ============= ==========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) Machine/Platform support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)   The ARM tree contains support for a lot of different machine types.  To
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)   continue supporting these differences, it has become necessary to split
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)   machine-specific parts by directory.  For this, the machine category is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)   used to select which directories and files get included (we will use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)   $(MACHINE) to refer to the category)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)   To this end, we now have arch/arm/mach-$(MACHINE) directories which are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)   designed to house the non-driver files for a particular machine (eg, PCI,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)   memory management, architecture definitions etc).  For all future
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)   machines, there should be a corresponding arch/arm/mach-$(MACHINE)/include/mach
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)   directory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) Modules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) -------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)   Although modularisation is supported (and required for the FP emulator),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)   each module on an ARM2/ARM250/ARM3 machine when is loaded will take
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)   memory up to the next 32k boundary due to the size of the pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)   Therefore, is modularisation on these machines really worth it?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)   However, ARM6 and up machines allow modules to take multiples of 4k, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)   as such Acorn RiscPCs and other architectures using these processors can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)   make good use of modularisation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) ADFS Image files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)   You can access image files on your ADFS partitions by mounting the ADFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)   partition, and then using the loopback device driver.  You must have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)   losetup installed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)   Please note that the PCEmulator DOS partitions have a partition table at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)   the start, and as such, you will have to give '-o offset' to losetup.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) Request to developers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)   When writing device drivers which include a separate assembler file, please
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)   include it in with the C file, and not the arch/arm/lib directory.  This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)   allows the driver to be compiled as a loadable module without requiring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)   half the code to be compiled into the kernel image.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)   In general, try to avoid using assembler unless it is really necessary.  It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)   makes drivers far less easy to port to other hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) ST506 hard drives
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)   The ST506 hard drive controllers seem to be working fine (if a little
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)   slowly).  At the moment they will only work off the controllers on an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)   A4x0's motherboard, but for it to work off a Podule just requires
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)   someone with a podule to add the addresses for the IRQ mask and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)   HDC base to the source.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)   As of 31/3/96 it works with two drives (you should get the ADFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)   `*configure` harddrive set to 2). I've got an internal 20MB and a great
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)   big external 5.25" FH 64MB drive (who could ever want more :-) ).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)   I've just got 240K/s off it (a dd with bs=128k); thats about half of what
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)   RiscOS gets; but it's a heck of a lot better than the 50K/s I was getting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)   last week :-)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)   Known bug: Drive data errors can cause a hang; including cases where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)   the controller has fixed the error using ECC. (Possibly ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)   in that case...hmm).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 1772 Floppy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)   This also seems to work OK, but hasn't been stressed much lately.  It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)   hasn't got any code for disc change detection in there at the moment which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)   could be a bit of a problem!  Suggestions on the correct way to do this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)   are welcome.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) `CONFIG_MACH_` and `CONFIG_ARCH_`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) ---------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)   A change was made in 2003 to the macro names for new machines.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)   Historically, `CONFIG_ARCH_` was used for the bonafide architecture,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)   e.g. SA1100, as well as implementations of the architecture,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)   e.g. Assabet.  It was decided to change the implementation macros
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)   to read `CONFIG_MACH_` for clarity.  Moreover, a retroactive fixup has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)   not been made because it would complicate patching.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)   Previous registrations may be found online.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)     <http://www.arm.linux.org.uk/developer/machines/>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) Kernel entry (head.S)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)   The initial entry into the kernel is via head.S, which uses machine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)   independent code.  The machine is selected by the value of 'r1' on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)   entry, which must be kept unique.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)   Due to the large number of machines which the ARM port of Linux provides
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)   for, we have a method to manage this which ensures that we don't end up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)   duplicating large amounts of code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)   We group machine (or platform) support code into machine classes.  A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)   class typically based around one or more system on a chip devices, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)   acts as a natural container around the actual implementations.  These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)   classes are given directories - arch/arm/mach-<class> - which contain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)   the source files and include/mach/ to support the machine class.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)   For example, the SA1100 class is based upon the SA1100 and SA1110 SoC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)   devices, and contains the code to support the way the on-board and off-
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)   board devices are used, or the device is setup, and provides that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)   machine specific "personality."
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)   For platforms that support device tree (DT), the machine selection is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)   controlled at runtime by passing the device tree blob to the kernel.  At
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)   compile-time, support for the machine type must be selected.  This allows for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)   a single multiplatform kernel build to be used for several machine types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)   For platforms that do not use device tree, this machine selection is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)   controlled by the machine type ID, which acts both as a run-time and a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)   compile-time code selection method.  You can register a new machine via the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)   web site at:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)     <http://www.arm.linux.org.uk/developer/machines/>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)   Note: Please do not register a machine type for DT-only platforms.  If your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)   platform is DT-only, you do not need a registered machine type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) ---
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) Russell King (15/03/2004)