diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-14 09:29:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-06-14 09:29:53 +0200 |
commit | 253412624e0fa60a309c6691b0cd99b6c341df87 (patch) | |
tree | d261ea96f8b29388beb93ec1b05b7b972aa548c1 /Documentation | |
parent | 6191ef93b25edbd75caec9213db3665f486ee433 (diff) | |
parent | c35624d1946a4756c93bdb489f4790176b6e2dcc (diff) | |
download | barebox-253412624e0fa60a309c6691b0cd99b6c341df87.tar.gz barebox-253412624e0fa60a309c6691b0cd99b6c341df87.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/boards/mvebu.rst | 10 | ||||
-rw-r--r-- | Documentation/boards/mvebu/Netgear-ReadyNAS-2120.rst | 13 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/firmware/altr,passive-serial.txt | 3 | ||||
-rw-r--r-- | Documentation/user/booting-linux.rst | 56 | ||||
-rw-r--r-- | Documentation/user/random.rst | 63 | ||||
-rw-r--r-- | Documentation/user/usb.rst | 21 | ||||
-rw-r--r-- | Documentation/user/user-manual.rst | 1 |
7 files changed, 135 insertions, 32 deletions
diff --git a/Documentation/boards/mvebu.rst b/Documentation/boards/mvebu.rst index b4f8e6043d..8e5612283e 100644 --- a/Documentation/boards/mvebu.rst +++ b/Documentation/boards/mvebu.rst @@ -28,14 +28,18 @@ initialisation that could be taken. Booting second stage -------------------- -This is currently not possible because barebox assumes the registers are mapped -at 0xd0000000 as is the case when the boot ROM gives control to the bootloader. +Since ``v2017.04.0`` barebox can boot a barebox image even if the register +window is moved. This is implemented by writing the actual window position +into the image where it is then picked up by the second stage bootloader. Booting from UART ----------------- The mvebu SoCs support booting from UART. For this there is a tool available in -barebox called kwboot. +barebox called ``kwboot``. Quite some mvebu boards are reset once more when +they already started to read the first block of the image to boot. If you want +to boot such a board, use the parameter ``-n 15`` for ``kwboot``. (The number +might have to be adapted per board.) mvebu boards ------------ diff --git a/Documentation/boards/mvebu/Netgear-ReadyNAS-2120.rst b/Documentation/boards/mvebu/Netgear-ReadyNAS-2120.rst index 5bee03af9d..488af2d7ac 100644 --- a/Documentation/boards/mvebu/Netgear-ReadyNAS-2120.rst +++ b/Documentation/boards/mvebu/Netgear-ReadyNAS-2120.rst @@ -6,14 +6,5 @@ This is a rack mountable 4 bay NAS using an Armada XP dual-core processor. UART booting ------------ -The first UART hides behind a sticker on 4 pins. - -The machine seems to do two resets at power on which makes UART booting hard. A -trick to work around this is:: - - scripts/kwboot -d /dev/ttyUSB0; kwboot -b images/barebox-netgear-rn2120.img -t /dev/ttyUSB0 - -This way the first window in which the CPU accepts the magic string is taken by -the first invokation which blocks until the second reset happens. The second -window is then hit with the image to boot. This is not 100% reliable but works -most of the time. +The UART that can be used to boot via RS232 (using ``kwboot``) hides behind a +sticker on the backside of the machine. It uses TTL levels. diff --git a/Documentation/devicetree/bindings/firmware/altr,passive-serial.txt b/Documentation/devicetree/bindings/firmware/altr,passive-serial.txt index d357dd39cf..eec12fbace 100644 --- a/Documentation/devicetree/bindings/firmware/altr,passive-serial.txt +++ b/Documentation/devicetree/bindings/firmware/altr,passive-serial.txt @@ -6,7 +6,8 @@ passive serial mode. This is used to upload the firmware and to start the FPGA. Required properties: -- compatible: shall be "altr,fpga-passive-serial" +- compatible: shall be "altr,fpga-passive-serial" or + "altr,fpga-arria10-passive-serial" for Arria 10 - reg: SPI chip select - nstat-gpios: Specify GPIO for controlling the nstat pin - confd-gpios: Specify GPIO for controlling the confd pin diff --git a/Documentation/user/booting-linux.rst b/Documentation/user/booting-linux.rst index f26299efd9..66f64ece08 100644 --- a/Documentation/user/booting-linux.rst +++ b/Documentation/user/booting-linux.rst @@ -229,10 +229,10 @@ time. Network boot ------------ -With the following steps barebox can start the Kernel and root filesystem -over network, a standard development case. +With the following steps, barebox can start the kernel and root filesystem +over the network, a standard development case. -Configure network: edit ``/env/network/eth0``. For a standard dhcp setup +Configure network: edit ``/env/network/eth0``. For a standard DHCP setup the following is enough: .. code-block:: sh @@ -242,8 +242,11 @@ the following is enough: ip=dhcp serverip=192.168.23.45 -serverip is only necessary if it differs from the serverip offered from the dhcp server. -A static ip setup can look like this: +The optional setting ``serverip`` specifies the IP address of your TFTP and NFS +server, and is only necessary if it differs from the server IP offered by the +DHCP server (i.e., the field ``siaddr`` in the DHCP ACK Reply). + +A static IP setup can look like this: .. code-block:: sh @@ -255,27 +258,43 @@ A static ip setup can look like this: gateway=192.168.2.1 serverip=192.168.2.1 -Note that barebox will pass the same ip settings to the kernel, i.e. it passes -``ip=$ipaddr:$serverip:$gateway:$netmask::eth0:`` for a static ip setup and -``ip=dhcp`` for a dynamic dhcp setup. +Note that barebox will pass the same IP settings to the kernel, i.e. it passes +``ip=$ipaddr:$serverip:$gateway:$netmask::eth0:`` for a static IP setup and +``ip=dhcp`` for a dynamic DHCP setup. -Adjust ``global.user`` and maybe ``global.hostname`` in ``/env/config``:: +By default, barebox uses the variables ``global.user`` and ``global.hostname`` +to retrieve its kernel image over TFTP, which makes it possible to use multiple +boards for multiple users with one single server. +You can adjust those variables in ``/env/config``:: global.user=sha global.hostname=efikasb -Copy the kernel (and devicetree if needed) to the base dir of the TFTP server:: +Copy the kernel (and devicetree if needed) to the root directory of your TFTP +server, and name them accordingly; for example:: cp zImage /tftpboot/sha-linux-efikasb cp myboard.dtb /tftpboot/sha-oftree-efikasb -barebox will pass ``nfsroot=/home/${global.user}/nfsroot/${global.hostname}`` -This may be a link to another location on the NFS server. Make sure that the -link target is exported from the server. - -``boot net`` will then start the Kernel. - -If the paths or names are not suitable they can be adjusted in +(In this example, the directory ``/tftpboot`` represents the root directory of +the TFTP server. +That directory depends on the configuration of your TFTP server, some servers +may also use ``/srv/tftp`` instead.) + +barebox will pass ``nfsroot=/home/${global.user}/nfsroot/${global.hostname}`` to +the kernel. +This causes the kernel to mount its root filesystem from a NFS server, which is +detected through the DHCP reply. +To choose a different server, simply prepend its IP address to the mount path, +e.g. ``nfsroot=192.168.23.5:/home/...``. +In any case, make sure that the specified mountpoint is exported by your NFS +server. + +For more information about booting with ``nfsroot``, see +`Documentation/filesystems/nfs/nfsroot.txt <https://github.com/torvalds/linux/blob/master/Documentation/filesystems/nfs/nfsroot.txt>`__ +in the Linux kernel documentation. + +If the preconfigured paths or names are not suitable, they can be adjusted in ``/env/boot/net``: .. code-block:: sh @@ -294,3 +313,6 @@ If the paths or names are not suitable they can be adjusted in nfsroot="/home/${global.user}/nfsroot/${global.hostname}" bootargs-ip global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" + +``boot net`` will then retrieve the kernel (and also the device tree and +initramfs, if used) over TFTP and boot it. diff --git a/Documentation/user/random.rst b/Documentation/user/random.rst new file mode 100644 index 0000000000..95dad72e55 --- /dev/null +++ b/Documentation/user/random.rst @@ -0,0 +1,63 @@ +Random Number Generator support +=============================== + +Barebox provides two types of RNG sources - PRNG and HWRNG: + +- "A pseudorandom number generator (PRNG), also known as a deterministic random + bit generator (DRBG),[1] is an algorithm for generating a sequence of numbers + whose properties approximate the properties of sequences of random numbers. + The PRNG-generated sequence is not truly random, because it is completely + determined by a relatively small set of initial values, called the PRNG's seed + (which may include truly random values). Although sequences that are closer to + truly random can be generated using hardware random number generators." + Pseudorandom number generator. https://en.wikipedia.org/wiki/Pseudorandom_number_generator (2017.05.08). + The PRNG used by Barebox is LCG (linear congruential generator) non cryptographically + secure, so please use with caution. + +- The HWRNG framework is software that makes use of a special hardware feature on + your CPU, SoC or motherboard. It can‘t provide any guarantee about cryptographic + security of used HW. Please refer to vendor documentation and/or RNG certification. + +API +^^^ + +.. code-block:: c + + /* seed the PRNG. */ + void srand(unsigned int seed); + + /* Fill the buffer with PRNG bits. */ + void get_random_bytes(void *buf, int len); + + /* Fill the buffer with bits provided by HWRNG. + * This function may fail with a message “error: no HWRNG available!” + * in case HWRNG is not available or HW got some runtime error. + * If barebox is compiled with CONFIG_ALLOW_PRNG_FALLBACK, + * then get_crypto_bytes() will print “warning: falling back to Pseudo RNG source!” + * and use PRNG instead of returning error. + */ + int get_crypto_bytes(void *buf, int len); + +User interface +^^^^^^^^^^^^^^ + +- /dev/hwrng0 + provides access to first available HWRNG. To examine this source you can use: + +.. code-block:: sh + + md -s /dev/hwrng0 + +- /dev/prng + provides access to PRNG. To examine this source you can use: + +.. code-block:: sh + + md -s /dev/prng + +To seed PRNG from user space the :ref:`command_seed` is provided. For example: + +.. code-block:: sh + + seed 12345 + md -s /dev/prng diff --git a/Documentation/user/usb.rst b/Documentation/user/usb.rst index bbcb045cee..ec219cfbe4 100644 --- a/Documentation/user/usb.rst +++ b/Documentation/user/usb.rst @@ -216,3 +216,24 @@ mode. Once a specific mode has been selected it can't be changed later anymore. musb-hdrc: setup fifo_mode 4 musb-hdrc: 28/31 max ep, 16384/16384 memory barebox:/ + +USB Gadget autostart Support +---------------------------- + +Barebox can be configured to start usbgadget automatically by using global variables, +instead of creating boot script. This can be useful if autostart policy should be +chosen at boot time from other driver or script. +To get usbgadget autostart support barebox has to be compiled with +CONFIG_USB_GADGET_AUTOSTART enabled. + +USB Gadget autostart Options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``global.usbgadget.autostart`` + Boolean flag. If set to 1, usbgadget will be started automatically on boot and + enable USB OTG mode. (Default 0). +``global.usbgadget.acm`` + Boolean flag. If set to 1, CDC ACM function will be created. + See :ref:`command_usbgadget` -a. (Default 0). +``global.usbgadget.fastboot_function`` + Function description for fastboot. See :ref:`command_usbgadget` -A [desc]. diff --git a/Documentation/user/user-manual.rst b/Documentation/user/user-manual.rst index 435649f353..791c8e0979 100644 --- a/Documentation/user/user-manual.rst +++ b/Documentation/user/user-manual.rst @@ -33,6 +33,7 @@ Contents: reset-reason system-reset state + random * :ref:`search` * :ref:`genindex` |