diff --git a/Documentation/boards/imx.rst b/Documentation/boards/imx.rst index db889ee..56fd3ab 100644 --- a/Documentation/boards/imx.rst +++ b/Documentation/boards/imx.rst @@ -32,7 +32,9 @@ automatically at the end of the build process. The images generated by the build process can be directly written to an -SD card:: +SD card: + +.. code-block:: sh # with Multi Image support: cat images/barebox-freescale-imx51-babbage.img > /dev/sdd @@ -152,7 +154,9 @@ it is not built by default. Enable it explicitly in ``make menuconfig`` and install the libusb development package. On Debian, this can be done with ``apt-get install libusb-dev``. After compilation, the tool can be used -with only the image name as argument:: +with only the image name as argument: + +.. code-block:: sh scripts/imx/imx-usb-loader images/barebox-freescale-imx51-babbage.img diff --git a/Documentation/boards/imx/amazon-kindle-3.rst b/Documentation/boards/imx/amazon-kindle-3.rst index dffb7ef..6b5d9fe 100644 --- a/Documentation/boards/imx/amazon-kindle-3.rst +++ b/Documentation/boards/imx/amazon-kindle-3.rst @@ -15,7 +15,7 @@ mode by the SOC microcode when Vol+ is pressed during startup. A new USB device "SE Blank RINGO" should appear, barebox may be uploaded using -:: +.. code-block:: console $ scripts/imx/imx-usb-loader barebox.imximg @@ -26,7 +26,9 @@ Barebox may be used as drop-in replacement for the shipped bootloader. When installing the barebox imximg on the eMMC take care not to overwrite the partition table and vendor supplied serial numbers stored on the eMMC. -e.g. just write the imx-header and the application section:: +e.g. just write the imx-header and the application section: + +.. code-block:: sh memcpy -b -s barebox.imximg -d /dev/disk0.imx_header 1024 0 1024 memcpy -b -s barebox.imximg -d /dev/disk0.self 4096 0 195584 diff --git a/Documentation/boards/imx/garz-fricke-vincell.rst b/Documentation/boards/imx/garz-fricke-vincell.rst index 09d87d6..4127c8b 100644 --- a/Documentation/boards/imx/garz-fricke-vincell.rst +++ b/Documentation/boards/imx/garz-fricke-vincell.rst @@ -38,6 +38,8 @@ load -v -r -b 0x80100000 barebox-guf-vincell-lt.img exec -Once in barebox, the bootloader can now be persisted to NAND:: +Once in barebox, the bootloader can now be persisted to NAND: + +.. code-block:: sh barebox_update -t nand /mnt/tftp/barebox-guf-vincell-lt.img`` diff --git a/Documentation/boards/imx/nxp-imx8mq-evk.rst b/Documentation/boards/imx/nxp-imx8mq-evk.rst index 9dfa911..f0cdc34 100644 --- a/Documentation/boards/imx/nxp-imx8mq-evk.rst +++ b/Documentation/boards/imx/nxp-imx8mq-evk.rst @@ -14,7 +14,7 @@ As a part of DDR intialization routine NXP i.MX8MQ EVK requires and uses several binary firmware blobs that are distributed under a separate EULA and cannot be included in Barebox. In order to obtain -the do the following:: +them do the following:: wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-7.2.bin chmod +x firmware-imx-7.2.bin @@ -113,4 +113,4 @@ | O | | <--- off = low level | | | 1 2 | - +-----+ \ No newline at end of file + +-----+ diff --git a/Documentation/boards/imx/phytec-phycore-i.mx31.rst b/Documentation/boards/imx/phytec-phycore-i.mx31.rst index d9a981b..0feb222 100644 --- a/Documentation/boards/imx/phytec-phycore-i.mx31.rst +++ b/Documentation/boards/imx/phytec-phycore-i.mx31.rst @@ -26,11 +26,15 @@ How to get barebox for Phytec's phyCORE-i.MX31 ---------------------------------------------- -Using the default configuration:: +Using the default configuration: + +.. code-block:: sh make ARCH=arm pcm037_defconfig -Build the binary image:: +Build the binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv5compiler diff --git a/Documentation/boards/mips/dlink-dir-320.rst b/Documentation/boards/mips/dlink-dir-320.rst index 74d11ff..7595381 100644 --- a/Documentation/boards/mips/dlink-dir-320.rst +++ b/Documentation/boards/mips/dlink-dir-320.rst @@ -26,7 +26,9 @@ Connect your DIR-320 to your tftp-server network via one of four sockets. -Next, setup network on DIR-320 and run barebox.bin, e.g.:: +Next, setup network on DIR-320 and run barebox.bin, e.g.: + +.. code-block:: console CFE> ifconfig eth0 -addr=192.168.0.99 CFE> boot -tftp -addr=a0800000 -raw 192.168.0.1:barebox.bin diff --git a/Documentation/boards/mips/qemu-malta.rst b/Documentation/boards/mips/qemu-malta.rst index 0c4d639..2bb8135 100644 --- a/Documentation/boards/mips/qemu-malta.rst +++ b/Documentation/boards/mips/qemu-malta.rst @@ -4,7 +4,9 @@ Big-endian mode --------------- -QEMU run string:: +QEMU run string: + +.. code-block:: sh qemu-system-mips -nodefaults -M malta -m 256 \ -nographic -serial stdio -monitor null \ @@ -18,13 +20,17 @@ In little-endian mode the 32bit words in the boot flash image are swapped, a neat trick which allows bi-endian firmware. -You have to swap words of ``zbarebox.bin`` image, e.g.:: +You have to swap words of ``zbarebox.bin`` image, e.g.: + +.. code-block:: sh echo arch/mips/pbl/zbarebox.bin \ | cpio --create \ | cpio --extract --swap --unconditional -QEMU run string:: +QEMU run string: + +.. code-block:: sh qemu-system-mipsel -nodefaults -M malta -m 256 \ -nographic -serial stdio -monitor null \ @@ -39,7 +45,9 @@ N.B. There is no need to swap words in ``zbarebox.bin`` for little-endian GXemul! -GXemul run string:: +GXemul run string: + +.. code-block:: sh gxemul -Q -e malta -M 256 0xbfc00000:barebox-flash-image diff --git a/Documentation/boards/mvebu.rst b/Documentation/boards/mvebu.rst index e27aa28..9c99c81 100644 --- a/Documentation/boards/mvebu.rst +++ b/Documentation/boards/mvebu.rst @@ -14,7 +14,9 @@ ------------------ Traditionally the RAM initialisation happens with a binary blob that have to be -extracted from the vendor U-Boot:: +extracted from the vendor U-Boot: + +.. code-block:: sh scripts/kwbimage -x -i /dev/mtdblock0 -o . diff --git a/Documentation/boards/mxs/Chumby-Falconwing.rst b/Documentation/boards/mxs/Chumby-Falconwing.rst index 172d684..690ccad 100644 --- a/Documentation/boards/mxs/Chumby-Falconwing.rst +++ b/Documentation/boards/mxs/Chumby-Falconwing.rst @@ -20,11 +20,15 @@ How to get the bootloader binary image -------------------------------------- -Using the default configuration:: +Using the default configuration: + +.. code-block:: sh make ARCH=arm chumbyone_defconfig -Build the bootloader binary image:: +Build the bootloader binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv5compiler diff --git a/Documentation/boards/mxs/Freescale-i.MX23-evk.rst b/Documentation/boards/mxs/Freescale-i.MX23-evk.rst index cb73ec1..077ab73 100644 --- a/Documentation/boards/mxs/Freescale-i.MX23-evk.rst +++ b/Documentation/boards/mxs/Freescale-i.MX23-evk.rst @@ -19,11 +19,15 @@ How to get the bootloader binary image -------------------------------------- -Using the default configuration:: +Using the default configuration: + +.. code-block:: sh make ARCH=arm freescale-mx23-evk_defconfig -Build the bootloader binary image:: +Build the bootloader binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv5compiler diff --git a/Documentation/boards/mxs/KaRo-TX28.rst b/Documentation/boards/mxs/KaRo-TX28.rst index 6cad5eb..54b1ce7 100644 --- a/Documentation/boards/mxs/KaRo-TX28.rst +++ b/Documentation/boards/mxs/KaRo-TX28.rst @@ -24,11 +24,15 @@ How to get barebox for 'KARO's Starterkit 5' -------------------------------------------- -Using the default configuration:: +Using the default configuration: + +.. code-block:: sh make ARCH=arm tx28stk5_defconfig -Build the binary image:: +Build the binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv5compiler diff --git a/Documentation/boards/mxs/Olimex-olinuxino.rst b/Documentation/boards/mxs/Olimex-olinuxino.rst index a06eb33..2080653 100644 --- a/Documentation/boards/mxs/Olimex-olinuxino.rst +++ b/Documentation/boards/mxs/Olimex-olinuxino.rst @@ -9,11 +9,15 @@ How to get the bootloader binary image -------------------------------------- -Using the default configuration:: +Using the default configuration: + +.. code-block:: sh make ARCH=arm imx233-olinuxino_defconfig -Build the binary image:: +Build the binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv5compiler diff --git a/Documentation/boards/omap.rst b/Documentation/boards/omap.rst index c269751..717a38f 100644 --- a/Documentation/boards/omap.rst +++ b/Documentation/boards/omap.rst @@ -15,7 +15,9 @@ scripts on the net which describe how to prepare such a card (it needs special partitioning). The same procedure can be used for barebox. With such a card (assumed to be at /dev/sdc), the following can be used to build and install -barebox:: +barebox: + +.. code-block:: console # mount -t fat /dev/sdc1 /mnt # make panda_xload_defconfig diff --git a/Documentation/boards/openrisc.rst b/Documentation/boards/openrisc.rst index fe6c48c..f9d67f9 100644 --- a/Documentation/boards/openrisc.rst +++ b/Documentation/boards/openrisc.rst @@ -4,7 +4,9 @@ or1ksim ------- -Compile or1ksim emulator:: +Compile or1ksim emulator: + +.. code-block:: console $ cd ~/ $ git clone https://github.com/openrisc/or1ksim @@ -48,6 +50,8 @@ tap_dev = "tap0" end -Run or1ksim:: +Run or1ksim: + +.. code-block:: console $ ~/or1ksim/sim -f or1ksim.cfg barebox diff --git a/Documentation/boards/s3c/Digi-a9m2440.rst b/Documentation/boards/s3c/Digi-a9m2440.rst index d01a001..32d58b9 100644 --- a/Documentation/boards/s3c/Digi-a9m2440.rst +++ b/Documentation/boards/s3c/Digi-a9m2440.rst @@ -78,11 +78,15 @@ How to get the binary image --------------------------- -Configure with the default configuration:: +Configure with the default configuration: + +.. code-block:: sh make ARCH=arm a9m2440_defconfig -Build the binary image:: +Build the binary image: + +.. code-block:: sh make ARCH=arm CROSS_COMPILE=armv4compiler diff --git a/Documentation/boards/sandbox.rst b/Documentation/boards/sandbox.rst index 558f111..85a54e6 100644 --- a/Documentation/boards/sandbox.rst +++ b/Documentation/boards/sandbox.rst @@ -7,7 +7,9 @@ Building barebox for simulation ------------------------------- -The barebox sandbox can be built with the host compiler:: +The barebox sandbox can be built with the host compiler: + +.. code-block:: sh ARCH=sandbox make sandbox_defconfig ARCH=sandbox make @@ -17,6 +19,8 @@ Once you compile barebox for the sandbox, you can run it with:: +.. code-block:: console + $ barebox [] Available sandbox invocation options include: diff --git a/Documentation/boards/socfpga.rst b/Documentation/boards/socfpga.rst index cd0fffa..d732374 100644 --- a/Documentation/boards/socfpga.rst +++ b/Documentation/boards/socfpga.rst @@ -41,7 +41,9 @@ barebox searches for a file called barebox.bin. To boot barebox on a Terasic SoCkit, the procedure is as follows (sdb1 is the A2 and -sdb2 the FAT32 partition):: +sdb2 the FAT32 partition): + +.. code-block:: sh mount -t fat /dev/sdb2 /mnt make socfpga-xload_defconfig @@ -50,7 +52,9 @@ make barebox has now generated multiple files in the images directory. So for the SoCkit -proceed with:: +proceed with: + +.. code-block:: sh cat images/barebox-socfpga-sockit-xload.img > /dev/sdb1 cp images/barebox-socfpga-sockit.img /mnt/barebox.bin @@ -64,12 +68,16 @@ The Boot ROM loads the preloader starting from address 0x0 on the QSPI flash. barebox then searches for a barebox image at the 256K offset and loads it. -The default bootsource is SD card, so to change that to QSPI, you have to:: +The default bootsource is SD card, so to change that to QSPI, you have to: + +.. code-block:: sh make socfpga-xload_defconfig make menuconfig -And then select the options `MTD` and `SPI_CADENCE_QUADSPI`. Now:: +And then select the options `MTD` and `SPI_CADENCE_QUADSPI`. Now: + +.. code-block:: sh make cat images/barebox-socfpga--xload.img > /dev/mtd0 @@ -116,7 +124,9 @@ preloader settings directory 7. Click ``Ok`` than ``Generate`` -Now run the command:: +Now run the command: + +.. code-block:: sh scripts/socfpga_import_preloader @@ -141,7 +151,9 @@ * system.h * tclrpt.h -To add these files, run:: +To add these files, run: + +.. code-block:: sh scripts/socfpga_get_sequencer scripts/socfpga_sequencer_defines_defaults diff --git a/Documentation/boards/x86.rst b/Documentation/boards/x86.rst index d0528a3..4514a76 100644 --- a/Documentation/boards/x86.rst +++ b/Documentation/boards/x86.rst @@ -50,7 +50,8 @@ simple calulation: .. code-block:: none - sectors = (\ + 511) / 512 + + 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 diff --git a/Documentation/conf.py b/Documentation/conf.py index dbd4a80..ec6ec04 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -259,4 +259,4 @@ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False -highlight_language = 'sh' +highlight_language = 'none' diff --git a/Documentation/filesystems/fat.rst b/Documentation/filesystems/fat.rst index e39e34a..138e697 100644 --- a/Documentation/filesystems/fat.rst +++ b/Documentation/filesystems/fat.rst @@ -5,7 +5,9 @@ barebox supports FAT filesystems in both read and write modes with optional support for long filenames. A FAT filesystem can be mounted using the -:ref:`command_mount` command:: +:ref:`command_mount` command: + +.. code-block:: console barebox:/ mkdir /mnt barebox:/ mount /dev/disk0.0 fat /mnt diff --git a/Documentation/filesystems/nfs.rst b/Documentation/filesystems/nfs.rst index ab51241..3e40ae9 100644 --- a/Documentation/filesystems/nfs.rst +++ b/Documentation/filesystems/nfs.rst @@ -7,7 +7,9 @@ barebox has readonly support for NFSv3 in UDP mode. -Example:: +Example: + +.. code-block:: console barebox:/ mount -t nfs 192.168.23.4:/home/user/nfsroot /mnt/nfs @@ -15,7 +17,9 @@ This parameter holds a Linux kernel commandline snippet containing a suitable root= option for booting from exactly that NFS share. -Example:: +Example: + +.. code-block:: console barebox:/ devinfo nfs0 ... diff --git a/Documentation/filesystems/pstore.rst b/Documentation/filesystems/pstore.rst index 8eee374..22e89b3 100644 --- a/Documentation/filesystems/pstore.rst +++ b/Documentation/filesystems/pstore.rst @@ -20,7 +20,7 @@ none on /pstore type pstore pstore may add additional warnings during boot due to wrong ECCs (no data -written):: +written): .. code-block:: none diff --git a/Documentation/filesystems/ramfs.rst b/Documentation/filesystems/ramfs.rst index d27f885..e61505a 100644 --- a/Documentation/filesystems/ramfs.rst +++ b/Documentation/filesystems/ramfs.rst @@ -7,6 +7,8 @@ mounted during startup on /. The filesystem type passed to ``mount`` is ``ramfs``. -Example:: +Example: + +.. code-block:: console barebox:/ mount none ramfs /somedir diff --git a/Documentation/filesystems/smhfs.rst b/Documentation/filesystems/smhfs.rst index 9e9993c..8f8a0ec 100644 --- a/Documentation/filesystems/smhfs.rst +++ b/Documentation/filesystems/smhfs.rst @@ -18,7 +18,9 @@ :ref:`command_ls` to a SMHFS-mounted path will show an empty directory. Nevertheless, the files are there. -Example:: +Example: + +.. code-block:: console barebox:/ mount -t smhfs /dev/null /mnt/smhfs diff --git a/Documentation/filesystems/squashfs.rst b/Documentation/filesystems/squashfs.rst index 88c97eb..a042f7b 100644 --- a/Documentation/filesystems/squashfs.rst +++ b/Documentation/filesystems/squashfs.rst @@ -6,7 +6,9 @@ SquashFS is a highly compressed read-only filesystem for Linux. It uses zlib, lzo or xz compression to compress both files, inodes and directories. A SquashFS filesystem can be mounted using the -:ref:`command_mount` command:: +:ref:`command_mount` command: + +.. code-block:: console barebox:/ mkdir /mnt barebox:/ mount -t squashfs /dev/spiflash.FileSystem /mnt diff --git a/Documentation/filesystems/tftp.rst b/Documentation/filesystems/tftp.rst index eeb3fcb..a292765 100644 --- a/Documentation/filesystems/tftp.rst +++ b/Documentation/filesystems/tftp.rst @@ -12,7 +12,9 @@ directories. This means a :ref:`ls ` to a TFTP-mounted path will show an empty directory. Nevertheless, the files are there. -Example:: +Example: + +.. code-block:: console barebox:/ mount -t tftp 192.168.23.4 /mnt/tftp diff --git a/Documentation/user/automount.rst b/Documentation/user/automount.rst index 7de8261..1fdeffc 100644 --- a/Documentation/user/automount.rst +++ b/Documentation/user/automount.rst @@ -10,7 +10,9 @@ when necessary, so barebox does not lose time probing unused devices. Typical usage is for accessing the TFTP server. To set up an automount for a -TFTP server, the following is required:: +TFTP server, the following is required: + +.. code-block:: sh mkdir -p /mnt/tftp automount /mnt/tftp 'ifup -a && mount -t tftp $global.net.server /mnt/tftp' @@ -21,12 +23,16 @@ using :ref:`command_mount`. Usually the above automount command is executed from an init script in ``/env/init/automount``. -With the above, files on the TFTP server can be accessed without configuration:: +With the above, files on the TFTP server can be accessed without configuration: + +.. code-block:: sh cp /mnt/tftp/linuximage /image This automatically detects a USB mass storage device and mounts the first -partition to ``/mnt/fat``:: +partition to ``/mnt/fat``: + +.. code-block:: sh mkdir -p /mnt/fat automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat' diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst index 82a33a3..026ed1b 100644 --- a/Documentation/user/barebox.rst +++ b/Documentation/user/barebox.rst @@ -181,9 +181,7 @@ The resulting binary varies depending on the board barebox is compiled for. Without :ref:`multi_image` support the ``barebox-flash-image`` link will point to the binary for flashing/uploading to the board. With :ref:`multi_image` support -the compilation process will finish with a list of images built under ``images/``: - -.. code-block:: sh +the compilation process will finish with a list of images built under ``images/``:: images built: barebox-freescale-imx51-babbage.img diff --git a/Documentation/user/defaultenv-2.rst b/Documentation/user/defaultenv-2.rst index 7502d3d..a79ae83 100644 --- a/Documentation/user/defaultenv-2.rst +++ b/Documentation/user/defaultenv-2.rst @@ -44,7 +44,9 @@ This script is executed by the barebox startup code after initialization. In defaultenv-2, this script will define and set a number of global -variables, followed by sourcing all of the scripts in ``/env/init/`` with:: +variables, followed by sourcing all of the scripts in ``/env/init/`` with: + +.. code-block:: sh for i in /env/init/*; do . $i diff --git a/Documentation/user/driver-model.rst b/Documentation/user/driver-model.rst index ce70835..a0fd3e9 100644 --- a/Documentation/user/driver-model.rst +++ b/Documentation/user/driver-model.rst @@ -32,7 +32,9 @@ devices should not delay booting when USB may not even be used. This case is handled with device detection. The user visible interface to device detection is the :ref:`command_detect` command. ``detect -l`` shows a list of detectable -devices:: +devices: + +.. code-block:: console barebox:/ detect -l 70004000.esdhc @@ -46,7 +48,9 @@ mmc1 miibus0 -A particular device can be detected with ``detect ``:: +A particular device can be detected with ``detect ``: + +.. code-block:: console barebox:/ detect 73f80200.usb Found SMSC USB331x ULPI transceiver (0x0424:0x0006). @@ -67,7 +71,9 @@ Devices can have parameters which can be used to configure devices or to provide additional information for a device. The parameters can be listed with the :ref:`command_devinfo` command. A ``devinfo `` will print the parameters -of a device:: +of a device: + +.. code-block:: console barebox:/ devinfo eth0 Parameters: @@ -77,12 +83,16 @@ netmask: 255.255.0.0 ethaddr: 00:1c:49:01:03:4b -The parameters can be used as shell variables:: +The parameters can be used as shell variables: + +.. code-block:: sh eth0.ipaddr=192.168.23.15 echo "my current ip is: $eth0.ipaddr" -device variables may have a type, so assigning wrong values may fail:: +device variables may have a type, so assigning wrong values may fail: + +.. code-block:: console barebox:/ eth0.ipaddr="This is not an IP" set parameter: Invalid argument diff --git a/Documentation/user/hush.rst b/Documentation/user/hush.rst index 00d4e29..a4d8688 100644 --- a/Documentation/user/hush.rst +++ b/Documentation/user/hush.rst @@ -13,13 +13,17 @@ Hush features ------------- -variables:: +variables: + +.. code-block:: sh a="Hello user" echo $a Hello user -conditional execution ``if`` / ``elif`` / ``else`` / ``fi``:: +conditional execution ``if`` / ``elif`` / ``else`` / ``fi``: + +.. code-block:: sh if [ ${foo} = ${bar} ]; then echo "foo equals bar" @@ -27,19 +31,25 @@ echo "foo and bar differ" fi -``for`` loops:: +``for`` loops: + +.. code-block:: sh for i in a b c; do echo $i done -``while`` loops:: +``while`` loops: + +.. code-block:: sh while true; do echo "endless loop" done -wildcard globbing:: +wildcard globbing: + +.. code-block:: sh ls d* echo ??? @@ -53,7 +63,9 @@ **NOTE:** hush feels like a normal Unix shell, but it cannot calculate by itself, i.e. $(($A/2)) won't work. Calculation can however be done -with :ref:`command_let`:: +with :ref:`command_let`: + +.. code-block:: sh A=10 let B=$A/2 diff --git a/Documentation/user/memory-areas.rst b/Documentation/user/memory-areas.rst index 9654a99..d673f6e 100644 --- a/Documentation/user/memory-areas.rst +++ b/Documentation/user/memory-areas.rst @@ -17,11 +17,15 @@ Examples -------- -Display a hexdump from 0x80000000 to 0x80001000 (inclusive):: +Display a hexdump from 0x80000000 to 0x80001000 (inclusive): + +.. code-block:: sh md 0x80000000-0x80001000 -Display 1 kilobyte of memory starting at 0x80000000:: +Display 1 kilobyte of memory starting at 0x80000000: + +.. code-block:: sh md 0x80000000+1k diff --git a/Documentation/user/system-setup.rst b/Documentation/user/system-setup.rst index f0598bc..5651569 100644 --- a/Documentation/user/system-setup.rst +++ b/Documentation/user/system-setup.rst @@ -16,7 +16,9 @@ Using the "screen" program ^^^^^^^^^^^^^^^^^^^^^^^^^^ -The terminal manager ``screen`` can also be used as a simple terminal emulator:: +The terminal manager ``screen`` can also be used as a simple terminal emulator: + +.. code-block:: sh screen /dev/ttyUSB0 115200 @@ -31,7 +33,9 @@ https://git.pengutronix.de/cgit/tools/microcom -Usage is simple:: +Usage is simple: + +.. code-block:: sh microcom -p /dev/ttyUSB0 @@ -46,7 +50,9 @@ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The ``dnsmasq`` program can be configured as a DHCP and TFTP server in addition -to its original DNS functionality:: +to its original DNS functionality: + +.. code-block:: sh sudo ip addr add 192.168.23.1/24 dev sudo ip link set up diff --git a/Documentation/user/updating.rst b/Documentation/user/updating.rst index 7aac0a9..0555909 100644 --- a/Documentation/user/updating.rst +++ b/Documentation/user/updating.rst @@ -11,12 +11,16 @@ do additional checks before trying an update, e.g. it's possible to check whether the new image actually is a barebox image. -Updating barebox can be as easy as:: +Updating barebox can be as easy as: + +.. code-block:: sh barebox_update /path/to/new/barebox.img Multiple handlers can be registered to the update mechanism. Usually the device -barebox has been started from is registered as default (marked with a ``*``):: +barebox has been started from is registered as default (marked with a ``*``): + +.. code-block:: console barebox:/ barebox_update -l registered update handlers: diff --git a/Documentation/user/variables.rst b/Documentation/user/variables.rst index e0a7941..ddfd485 100644 --- a/Documentation/user/variables.rst +++ b/Documentation/user/variables.rst @@ -12,12 +12,16 @@ The ``global`` device is a special purpose device. It only exists as a storage for global variables. Some global variables are created internally in barebox (see :ref:`magicvars`). Additional variables can be created with -the :ref:`command_global` command:: +the :ref:`command_global` command: + +.. code-block:: sh global myvar This creates the ``global.myvar`` variable which now can be used like any -other variable. You can also directly assign a value during creation:: +other variable. You can also directly assign a value during creation: + +.. code-block:: sh global myvar1=foobar @@ -48,7 +52,7 @@ examples: -.. code-block:: sh +.. code-block:: console barebox@Phytec phyCARD-i.MX27:/ devinfo nv barebox@Phytec phyCARD-i.MX27:/ nv model=myboard @@ -94,7 +98,9 @@ of barebox. Most but not all of them are consolidated in the :ref:`global_device`. Since it's hard to remember which variables these are and if the current barebox has support for them the :ref:`command_magicvar` command can print a list -of all variables with special meaning along with a short description:: +of all variables with special meaning along with a short description: + +.. code-block:: console barebox:/ magicvar OPTARG optarg for hush builtin getopt diff --git a/commands/of_node.c b/commands/of_node.c index 29cc371..28c4357 100644 --- a/commands/of_node.c +++ b/commands/of_node.c @@ -107,11 +107,10 @@ } } - if (optind == argc) + if (optind + 1 != argc) return COMMAND_ERROR_USAGE; - if (optind < argc) - path = argv[optind]; + path = argv[optind]; if (!path) return COMMAND_ERROR_USAGE; @@ -147,7 +146,7 @@ BAREBOX_CMD_START(of_node) .cmd = do_of_node, BAREBOX_CMD_DESC("create/delete nodes in the device tree") - BAREBOX_CMD_OPTS("[-cd] [-f] NODE NAME") + BAREBOX_CMD_OPTS("[-cd] [-f] NODEPATH") BAREBOX_CMD_GROUP(CMD_GRP_MISC) BAREBOX_CMD_COMPLETE(devicetree_complete) BAREBOX_CMD_HELP(cmd_of_node_help) diff --git a/common/image-fit.c b/common/image-fit.c index 6cbf232..dfd1fa0 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -289,11 +289,12 @@ } key_path = xasprintf("/signature/key-%s", key_name); key_node = of_find_node_by_path(key_path); - free(key_path); if (!key_node) { - pr_info("failed to find key node\n"); + pr_info("failed to find key node %s\n", key_path); + free(key_path); return -ENOENT; } + free(key_path); ret = rsa_of_read_key(key_node, &key); if (ret) { diff --git a/drivers/aiodev/Kconfig b/drivers/aiodev/Kconfig index 8bad946..3eabd3b 100644 --- a/drivers/aiodev/Kconfig +++ b/drivers/aiodev/Kconfig @@ -7,10 +7,12 @@ if AIODEV config IMX_THERMAL - tristate "Temperature sensor driver for Freescale i.MX SoCs" - depends on ARCH_IMX6 - select MFD_SYSCON - help + tristate "Temperature sensor driver for Freescale i.MX SoCs" + depends on ARCH_IMX6 + select MFD_SYSCON + select NVMEM + select IMX_OCOTP + help Support for Temperature Monitor (TEMPMON) found on Freescale i.MX SoCs. diff --git a/drivers/mci/s3c.c b/drivers/mci/s3c.c index 86a83b6..4896097 100644 --- a/drivers/mci/s3c.c +++ b/drivers/mci/s3c.c @@ -755,7 +755,7 @@ s3c_host->host.f_min = pd->f_min == 0 ? s3c_get_pclk() / 256 : pd->f_min; s3c_host->host.f_max = pd->f_max == 0 ? s3c_get_pclk() / 2 : pd->f_max; - if (IS_ENABLED(iCONFIG_MCI_INFO)) + if (IS_ENABLED(CONFIG_MCI_INFO)) hw_dev->info = s3c_info; /* diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c index 3f39db7..dda022e 100644 --- a/drivers/net/e1000/eeprom.c +++ b/drivers/net/e1000/eeprom.c @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include #include "e1000.h" @@ -405,6 +407,45 @@ eeprom->read = e1000_read_eeprom_microwire; } +size_t e1000_igb_get_flash_size(struct e1000_hw *hw) +{ + struct device_node *node = + hw->pdev->dev.device_node; + u32 flash_size; + uint32_t fla; + int ret = 0; + + /* + * There are two potential places where the size of the flash can be + * specified. In the device tree, and in the flash itself. Use the + * first that looks valid. + */ + + ret = of_property_read_u32(node, "flash-size", &flash_size); + if (ret == 0) { + dev_info(hw->dev, + "Determined flash size from device tree (%u)\n", + flash_size); + return flash_size; + } + + fla = e1000_read_reg(hw, E1000_FLA); + fla &= E1000_FLA_FL_SIZE_MASK; + fla >>= E1000_FLA_FL_SIZE_SHIFT; + + if (fla) { + flash_size = SZ_64K << fla; + dev_info(hw->dev, + "Determined flash size from E1000_FLA.FL_SIZE (%u)\n", + flash_size); + return flash_size; + } + + dev_info(hw->dev, + "Unprogrammed Flash detected and no flash-size found in device tree, limiting access to first 4 kiB\n"); + + return 4096; +} /****************************************************************************** * Sets up eeprom variables in the hw struct. Must be called after mac_type @@ -480,20 +521,7 @@ case e1000_igb: if (eecd & E1000_EECD_I210_FLASH_DETECTED) { - uint32_t fla; - - fla = e1000_read_reg(hw, E1000_FLA); - fla &= E1000_FLA_FL_SIZE_MASK; - fla >>= E1000_FLA_FL_SIZE_SHIFT; - - if (fla) { - eeprom->word_size = (SZ_64K << fla) / 2; - } else { - eeprom->word_size = 2048; - dev_info(hw->dev, "Unprogrammed Flash detected, " - "limiting access to first 4KB\n"); - } - + eeprom->word_size = e1000_igb_get_flash_size(hw) / 2; eeprom->acquire = e1000_acquire_eeprom_flash; eeprom->release = e1000_release_eeprom_flash; } diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c index dd081ee..b6faa02 100644 --- a/drivers/reset/reset-socfpga.c +++ b/drivers/reset/reset-socfpga.c @@ -113,6 +113,7 @@ }; static struct driver_d socfpga_reset_driver = { + .name = "socfpga_reset", .probe = socfpga_reset_probe, .of_compatible = DRV_OF_COMPAT(socfpga_reset_dt_ids), }; diff --git a/net/eth.c b/net/eth.c index 5d45a04..9dc4411 100644 --- a/net/eth.c +++ b/net/eth.c @@ -40,7 +40,7 @@ struct eth_ethaddr { struct list_head list; - u8 ethaddr[6]; + u8 ethaddr[ETH_ALEN]; int ethid; struct device_node *node; }; @@ -82,7 +82,7 @@ list_for_each_entry(addr, ðaddr_list, list) { if ((node && node == addr->node) || addr->ethid == edev->dev.id) { - memcpy(buf, addr->ethaddr, 6); + memcpy(buf, addr->ethaddr, ETH_ALEN); return 0; } } @@ -118,7 +118,7 @@ addr = xzalloc(sizeof(*addr)); addr->ethid = ethid; - memcpy(addr->ethaddr, ethaddr, 6); + memcpy(addr->ethaddr, ethaddr, ETH_ALEN); list_add_tail(&addr->list, ðaddr_list); } @@ -150,7 +150,7 @@ addr = xzalloc(sizeof(*addr)); addr->node = node; - memcpy(addr->ethaddr, ethaddr, 6); + memcpy(addr->ethaddr, ethaddr, ETH_ALEN); list_add_tail(&addr->list, ðaddr_list); } @@ -284,7 +284,7 @@ #ifdef CONFIG_OFTREE static void eth_of_fixup_node(struct device_node *root, const char *node_path, int ethid, - const u8 ethaddr[6]) + const u8 ethaddr[ETH_ALEN]) { struct device_node *node; int ret; @@ -308,7 +308,7 @@ return; } - ret = of_set_property(node, "mac-address", ethaddr, 6, 1); + ret = of_set_property(node, "mac-address", ethaddr, ETH_ALEN, 1); if (ret) pr_err("Setting mac-address property of %s failed with: %s\n", node->full_name, strerror(-ret)); @@ -355,7 +355,7 @@ int eth_register(struct eth_device *edev) { struct device_d *dev = &edev->dev; - unsigned char ethaddr[6]; + unsigned char ethaddr[ETH_ALEN]; int ret, found = 0; if (!edev->get_ethaddr) {