summaryrefslogtreecommitdiffstats
path: root/Documentation/boards
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-04-15 14:01:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-04-15 14:01:56 +0200
commitb463adfd95354b4603544215eada98284f2be090 (patch)
treea44bff3dadaeb9218ba581d4a9f135877c14a7eb /Documentation/boards
parente61c75c259af8601a671e14237b464e0d49fd0df (diff)
parent94f2da7d81cfd83685af24967e89347e7aea2ccb (diff)
downloadbarebox-b463adfd95354b4603544215eada98284f2be090.tar.gz
barebox-b463adfd95354b4603544215eada98284f2be090.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'Documentation/boards')
-rw-r--r--Documentation/boards/openrisc.rst68
-rw-r--r--Documentation/boards/x86.rst153
2 files changed, 68 insertions, 153 deletions
diff --git a/Documentation/boards/openrisc.rst b/Documentation/boards/openrisc.rst
index f9d67f9650..34586b4a76 100644
--- a/Documentation/boards/openrisc.rst
+++ b/Documentation/boards/openrisc.rst
@@ -1,6 +1,74 @@
OpenRISC
========
+Optaining an OpenRISC toolchain
+-------------------------------
+
+Toolchain binaries can be obtained from openrisc.io or our github releases page.
+Instructions for building the different toolchains can be found on openrisc.io
+or Stafford's toolchain build and release scripts.
+
+See:
+
+ * https://github.com/stffrdhrn/gcc/releases
+ * https://github.com/stffrdhrn/or1k-toolchain-build
+ * https://openrisc.io/software
+
+Example of downloading and installing a toolchain::
+
+ $ curl --remote-name --location \
+ https://github.com/stffrdhrn/gcc/releases/download/or1k-10.0.0-20190723/or1k-elf-10.0.0-20190723.tar.xz
+ $ tar -xf or1k-elf-10.0.0-20190723.tar.xz
+ $ export PATH=$PATH:$PWD/or1k-elf/bin
+
+Running OpenRISC barebox on qemu
+------------------------------
+
+Running barebox on qemu is similar to running linux on qemu see more details on
+the qemu wiki site at https://wiki.qemu.org/Documentation/Platforms/OpenRISC
+
+Compile the qemu emulator::
+
+ $ git clone https://gitlab.com/qemu-project/qemu.git
+ $ cd qemu
+ $ mkdir build ; cd build
+ $ ../configure \
+ --target-list="or1k-softmmu" \
+ --enable-fdt \
+ --disable-kvm \
+ --disable-xen \
+ --disable-xkbcommon \
+ --enable-debug \
+ --enable-debug-info
+ $ make
+
+Next compile barebox::
+
+ $ make ARCH=openrisc defconfig
+ ...
+ $ make ARCH=openrisc CROSS_COMPILE=or1k-elf-
+
+Run barebox::
+
+ $ <path to qemu source>/build/or1k-softmmu/qemu-system-or1k \
+ -cpu or1200 \
+ -M or1k-sim \
+ -kernel /home/shorne/work/openrisc/barebox/barebox \
+ -net nic -net tap,ifname=tap0,script=no,downscript=no \
+ -serial mon:stdio -nographic -gdb tcp::10001 \
+ -m 32
+
+
+ barebox 2021.02.0-00120-g763c6fee7-dirty #14 Thu Mar 4 05:13:51 JST 2021
+
+
+ Board: or1ksim
+ mdio_bus: miibus0: probed
+ malloc space: 0x01b80000 -> 0x01f7ffff (size 4 MiB)
+
+ Hit any to stop autoboot: 3
+ barebox@or1ksim:/
+
or1ksim
-------
diff --git a/Documentation/boards/x86.rst b/Documentation/boards/x86.rst
deleted file mode 100644
index c0d5a64b9d..0000000000
--- a/Documentation/boards/x86.rst
+++ /dev/null
@@ -1,153 +0,0 @@
-x86
-===
-
-.. note::
- This is about legacy x86 PC boot, which is not as well supported as booting
- under UEFI. Refer to :doc:`boards/efi.rst` for documentation on the barebox
- EFI support.
-
-Features
---------
-
-barebox can act as a bootloader for PC based systems. In this case a special
-binary layout will be created to be able to store it on some media the PC
-BIOS can boot from. It can boot Linux kernels stored also on the same boot
-media and be configured at runtime, with the possibility to store the changed
-configuration on the boot media.
-
-Restrictions
-------------
-
-Due to some BIOS and barebox restrictions the boot media must be
-prepared in some special way:
-
- * barebox must be stored in the MBR (Master Boot Record) of the boot
- media. Currently its not possible to store and boot it in one of
- the partition sectors to use it as a second stage loader). This is
- no eternal restriction. It only needs further effort to add this
- feature.
- * barebox currently cannot run a chained boot loader. Also, this is
- no external restriction, only further effort needed.
- * barebox comes with limited filesystem support. There is currently
- no support for the most common and popular filesystems used in the
- \*NIX world. This restricts locations where to store a kernel and
- other runtime information
- * barebox must be stored to the first n sectors of the boot media.
- To ensure this does not collide with partitions on the boot media,
- the first partition must start at a sector behind the ones barebox
- occupies.
- * barebox handles its runtime configuration in a special way: It
- stores it in a binary way into some reserved sectors ("persistant
- storage").
-
-Boot Preparations
------------------
-
-To store the barebox image to a boot media, it comes with the tool
-setupmbr in the directory scripts/setupmbr/ . To be able to use it on
-the boot media of your choice, some preparations are required.
-
-Keep Sectors free
------------------
-
-Build the barebox image and check its size. At least this amount of
-sectors must be kept free after the MBR prior the first partition. Do this
-simple calulation:
-
-.. code-block:: none
-
- sectors = (size of barebox image + 511) / 512
-
-To be able to store the runtime configuration, further free sectors are
-required. Its up to you and your requirements, how large this persistant
-storage must be. If you need 16 kiB for this purpose, you need to keep
-additional 32 sectors free.
-
-For this example we are reserving 300 sectors for the barebox image and
-additionaly 32 sectors for the persistant storage. So, the first partition on
-the boot media must start at sector 333 or later.
-
-Run the fdisk tool to setup such a partition table:
-
-.. code-block:: none
-
- [jb@host]~> fdisk /dev/sda
- Command (m for help): p
-
- Disk /dev/sda: 20.7 MB, 212680704 bytes
- 16 heads, 63 sectors/track, 406 cylinders
- Units = cylinders of 1008 * 512 = 516096 bytes
-
- Device Boot Start End Blocks Id System
-
-Change the used units to sectors for easier handling.
-
-.. code-block:: none
-
- Command (m for help): u
- Changing display/entry units to sectors
-
- Command (m for help): p
-
- Disk /dev/sda: 20.7 MB, 212680704 bytes
- 16 heads, 63 sectors/track, 406 cylinders, total 409248 sectors
- Units = sectors of 1 * 512 = 512 bytes
-
- Device Boot Start End Blocks Id System
-
-Now its possible to create the first partition with the required offset:
-
-.. code-block:: none
-
- Command (m for help): n
- Command action
- e extended
- p primary partition (1-4)
- p
- Partition number (1-4): 1
- First sector (63-409247, default 63): 333
- Last sector or +size or +sizeM or +sizeK (333-409247, default 409247): +18M
- Command (m for help): p
-
- Disk /dev/sda: 20.7 MB, 212680704 bytes
- 16 heads, 63 sectors/track, 406 cylinders, total 409248 sectors
- Units = sectors of 1 * 512 = 512 bytes
-
- Device Boot Start End Blocks Id System
- /dev/sda 333 35489 17578+ 83 Linux
-
-That's all. Do whatever is required now with the new partition (formatting
-and populating the root filesystem for example) to make it useful.
-
-In the next step, barebox gets installed to this boot media::
-
- [jb@host]~> scripts/setupmbr/setupmbr -s 32 -m ./barebox -d /dev/sda
-
-This command writes the barebox image file './barebox' onto the device
- /dev/sda.
-
-The -s option will keep the persistant storage sectors free and untouched
-and set flags in the MBR to forward its existance, size and location to
-barebox at runtime. setupmbr also does not change the partition table.
-
-The barebox image gets stored on the boot media like this::
-
- sector 0 1 33 333
- |---|-------------|--------------- ~~~ ------------|--------------
- MBR persistant barebox first
- storage main image partition
-
-If the -s option is omitted, the "persistant storage" part simply does
-not exist:
-
-.. code-block:: none
-
- sector 0 1 333
- |---|--------------- ~~~ ------------|--------------
- MBR barebox first
- main image partition
-
-**NOTE:** the ``setupmbr`` tool is also working on real image file than on device
-nodes only. So, there is no restriction what kind of file will be
-modified.
-