Files
Stefan Agner a0871be6c0 Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot

* Update buildroot to 2020.11-rc1

Signed-off-by: Stefan Agner <stefan@agner.ch>

* Don't rely on sfdisk --list-free output

The --list-free (-F) argument does not allow machine readable mode. And
it seems that the output format changes over time (different spacing,
using size postfixes instead of raw blocks).

Use sfdisk json output and calculate free partition space ourselfs. This
works for 2.35 and 2.36 and is more robust since we rely on output which
is meant for scripts to parse.

* Migrate defconfigs for Buildroot 2020.11-rc1

In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE).

* Rebase/remove systemd patches for systemd 246

* Drop apparmor/libapparmor from buildroot-external

* hassos-persists: use /run as directory for lockfiles

The U-Boot tools use /var/lock by default which is not created any more
by systemd by default (it is under tmpfiles legacy.conf, which we no
longer install).

* Disable systemd-update-done.service

The service is not suited for pure read-only systems. In particular the
service needs to be able to write a file in /etc and /var. Remove the
service. Note: This is a static service and cannot be removed using
systemd-preset.

* Disable apparmor.service for now

The service loads all default profiles. Some might actually cause
problems. E.g. the profile for ping seems not to match our setup for
/etc/resolv.conf:
[85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2020-11-13 18:25:44 +01:00
..

Marvell ESPRESSObin
===================

This default configuration allows you to quickly get up and running with
the Marvell ESPRESSObin board by Globalscale Technologies Inc.

The ESPRESSObin is based on the Marvell Armada 88F3720 SoC, coupled with
a Marvell 88E6341 switch core "Topaz", with three exposed gigabit ports.

     _________________________
    |#  U     W   L  L    U  #|
    |#  S     A   A  A    S  #|
    |#  B     N   N  N    B  #|
    |#            0  1       #|
    |#      Mini             #|
    |#      -PCI             #|
    |#                       #|
    |#  5                    #|
    |#__V___usb_PWR_SATA__SW_#|

    Fig 1: Overview of board

Notice difference in Ethernet port layout compared to the Globalscale
docs.  They order the ports; LAN2, LAN1, WAN (left to right in figure
above).  For more information, see http://espressobin.net


Building
--------

    $ make globalscale_espressobin_defconfig
    $ make

This generates the kernel image, the devicetree binary, the rootfs as a
tar.gz, and a filesystem image containing everything.

All build artifacts are located in `output/images/`


Booting
-------

To boot, you need a UART connection, using the on-board micro USB port
set to 115200 8N1.

By default, the ESPRESSObin comes with a pre-flashed U-Boot set up to
load the kernel, device-tree and rootfs from SPI NOR flash.  The board
jumpers can be changed to boot from different sources, see the quick
start guide for each board revision for details:

- ftp://downloads.globalscaletechnologies.com/Downloads/Espressobin/ESPRESSObin%20V5/
- ftp://downloads.globalscaletechnologies.com/Downloads/Espressobin/ESPRESSObin%20V7/

Note: the v5, and earlier, cannot boot from sdcard, so you have to set
up the factory U-Boot to boot into Buildroot:

1. Flash rootfs image to sdcard drive, your `of=` device may differ:

        $ sudo dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M
        $ sync

2. Boot board from SPI NOR, interrupt boot by pressing any key ...
3. Check with `printenv` that the default setup is OK, otherwise ensure
   the following are set, and define `bootcmd` for automatic boot:

        > setenv kernel_addr 0x5000000
        > setenv fdt_addr 0x1800000
        > setenv fdt_name boot/armada-3720-espressobin.dtb
        > setenv console console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000
        > setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $fdt_addr $fdt_name;setenv bootargs $console root=/dev/mmcblk0p1 rw rootwait; booti $kernel_addr - $fdt_addr'

4. Call the boot command, or `reset` the board to start:

        > run bootcmd


Networking
----------

To enable Ethernet networking, load the `mv88e6xxx` kernel module, and
bring up each respective interface needed:

    # modprobe mv88e6xxx
    # ifconfig wan up

A more advanced scenario is setting up switching between the ports using
the Linux bridge.  The kernel switchdev layer, and DSA driver, ensure
switch functions are "offloaded" to the HW switch, i.e., all traffic
between LAN ports never reach the CPU.  For this you need the iproute2
suite of tools.