From patchwork Fri May 8 09:45:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Wiberg X-Patchwork-Id: 1285919 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=uHuSUcCe; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49JQRp68Hcz9sSm for ; Fri, 8 May 2020 19:45:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D299921FAC; Fri, 8 May 2020 09:45:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xPqYohA2ZVxu; Fri, 8 May 2020 09:45:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 1141020524; Fri, 8 May 2020 09:45:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 46DC61BF852 for ; Fri, 8 May 2020 09:45:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 41D3220524 for ; Fri, 8 May 2020 09:45:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZlNtk57NPJAG for ; Fri, 8 May 2020 09:45:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by silver.osuosl.org (Postfix) with ESMTPS id 849CE203A7 for ; Fri, 8 May 2020 09:45:16 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id a4so907326lfh.12 for ; Fri, 08 May 2020 02:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version:organization :content-transfer-encoding; bh=fNH4IY63qfePVbvut6fT6/uS89zpBtpPr1Db7L5GDFY=; b=uHuSUcCeO/b9b9xNgZQHDsNFAugmNLrMvRbg+5vG/wszM+CI74vkjGCkoY+oI1exnn LkukB8DYVa4nNVBmHtcTAqBb6pbw7tb72iNfn0IizQVUtrgg3SJ3xMAxlMkbfAgwyU/J NVlQzlUTPrs2qKUe3JQs4spbdZr1aL6lSvNWTykshdpmlAp/T5yrwLY5kAoqS2g9V2zI yN5WLYIuMWL9F/jf20BGgSGBRxBBqAvFGcpsksu1DKOy7z5jKeUhfQr5X+NpWH6BSeZJ hqPguBZKuPbrhRM3D+eNtHHwtRmELQWAyBO81dPMffQnnl1Mylc0yTbwtjKrk7vsdt2Z vg7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :organization:content-transfer-encoding; bh=fNH4IY63qfePVbvut6fT6/uS89zpBtpPr1Db7L5GDFY=; b=hpI+cp0IlT7OPQ5+mnu0yRFEHTKWV1S4Oq+91/d2gHexlhFTRgOZFZqupw0mXtlOH1 DGiMACl2PLTDXGDIayHL9wtx/i5Bqq5aYyuZyWKecj9GoWt8BxDbFvvpDsxphZ1DiGEz NOIqjKAVaThhZmhCM5xDXPziu4ytcavawbV27ecgGd/qTp3rtP8KcNBE9+g3f19SAG0p +wPTdcLeGAfv/R6zThBK6/lqlOG/OesdkUEAvJv8SFE5n9vOh5Vvrplr9dbEO51+rzf4 1OVdvWnzc3WptnbqBDc9lQcskrwfF9DWHiuHxWpphkH6sWoGAuoJfALAmyGg2SGZ6bRu fAXw== X-Gm-Message-State: AOAM5306Q+CXJd/kb+2D5vez4edRW8/uxmAo4Q+tOnG6DKlcwkogT4SU DUv9rBTJykwOZ9911+ohac7eI/Doqjc= X-Google-Smtp-Source: ABdhPJxv7znJiuWEbMx43f4h4tzcJk2EIygYEZ+VY5V3Fm6ZnC29mcN6mamItUSJVQbyA6Dcuc556g== X-Received: by 2002:ac2:5215:: with SMTP id a21mr1294469lfl.13.1588931113887; Fri, 08 May 2020 02:45:13 -0700 (PDT) Received: from troglobit.westermo.com (h-98-128-228-21.NA.cust.bahnhof.se. [98.128.228.21]) by smtp.gmail.com with ESMTPSA id u21sm805906ljo.61.2020.05.08.02.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 02:45:13 -0700 (PDT) From: Joachim Nilsson To: buildroot@buildroot.org Date: Fri, 8 May 2020 11:45:09 +0200 Message-Id: <20200508094509.2574240-1-troglobit@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Organization: Westermo Network Technologies AB Subject: [Buildroot] [PATCH 1/1] configs/globalscale_espressobin: new defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joachim Nilsson Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Basic support for the Marvell ESPRESSObin, by Globalscale Technologies. http://espressobin.net The kernel config has been extended with a fragment to enable switchcore support, DSA drivers, and VLAN filtering in the bridge. To make use of this you need a custom libnl based application, or the iproute2 suite rather than the brctl tools, which don't support the VLAN filtering. Signed-off-by: Joachim Nilsson --- .gitlab-ci.yml | 1 + DEVELOPERS | 4 + board/globalscale/espressobin/genimage.cfg | 11 +++ .../espressobin/linux-extras.config | 14 +++ board/globalscale/espressobin/readme.txt | 90 +++++++++++++++++++ configs/globalscale_espressobin_defconfig | 26 ++++++ 6 files changed, 146 insertions(+) create mode 100644 board/globalscale/espressobin/genimage.cfg create mode 100644 board/globalscale/espressobin/linux-extras.config create mode 100644 board/globalscale/espressobin/readme.txt create mode 100644 configs/globalscale_espressobin_defconfig diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa8e077a07..071d76974a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -197,6 +197,7 @@ friendlyarm_nanopi_a64_defconfig: { extends: .defconfig } friendlyarm_nanopi_neo2_defconfig: { extends: .defconfig } friendlyarm_nanopi_neo_plus2_defconfig: { extends: .defconfig } galileo_defconfig: { extends: .defconfig } +globalscale_espressobin_defconfig: { extends: .defconfig } grinn_chiliboard_defconfig: { extends: .defconfig } grinn_liteboard_defconfig: { extends: .defconfig } hifive_unleashed_defconfig: { extends: .defconfig } diff --git a/DEVELOPERS b/DEVELOPERS index e427ab15d4..e926174797 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1291,6 +1291,10 @@ F: package/libuhttpd/ F: package/libuwsc/ F: package/rtty/ +N: Joachim Nilsson +F: configs/globalscale_espressobin_defconfig +F: board/globalscale/espressobin/ + N: Joao Pinto F: board/synopsys/vdk/ F: configs/snps_aarch64_vdk_defconfig diff --git a/board/globalscale/espressobin/genimage.cfg b/board/globalscale/espressobin/genimage.cfg new file mode 100644 index 0000000000..360c8f098f --- /dev/null +++ b/board/globalscale/espressobin/genimage.cfg @@ -0,0 +1,11 @@ +# Minimal image, no U-boot since v3/v5 cannot boot from sdcard, see +# readme.txt for details on configuring the on-board u-boot. +image sdcard.img { + hdimage { + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +} diff --git a/board/globalscale/espressobin/linux-extras.config b/board/globalscale/espressobin/linux-extras.config new file mode 100644 index 0000000000..7ce0a495c1 --- /dev/null +++ b/board/globalscale/espressobin/linux-extras.config @@ -0,0 +1,14 @@ +# +# The Espressobin has a switchcore with full support in the kernel. +# This fragment enables DSA and its drivers, inclding VLAN aware bridge +# support to allow users to easily set up a LAN switch + WAN interface. +# +CONFIG_NET_DSA=m +CONFIG_VLAN_8021Q=y + +CONFIG_BRIDGE=m +CONFIG_BRIDGE_IGMP_SNOOPING=y +CONFIG_BRIDGE_VLAN_FILTERING=y + +CONFIG_NET_DSA_MV88E6XXX=m +CONFIG_NET_DSA_MV88E6XXX_PTP=y diff --git a/board/globalscale/espressobin/readme.txt b/board/globalscale/espressobin/readme.txt new file mode 100644 index 0000000000..e519b1e1f4 --- /dev/null +++ b/board/globalscale/espressobin/readme.txt @@ -0,0 +1,90 @@ +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. diff --git a/configs/globalscale_espressobin_defconfig b/configs/globalscale_espressobin_defconfig new file mode 100644 index 0000000000..c0b9f69559 --- /dev/null +++ b/configs/globalscale_espressobin_defconfig @@ -0,0 +1,26 @@ +BR2_aarch64=y +BR2_cortex_a53=y +BR2_ARM_FPU_VFPV4=y + +# Linux headers same as kernel, a 5.6 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_6=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.6.11" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/globalscale/espressobin/linux-extras.config" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="marvell/armada-3720-espressobin marvell/armada-3720-espressobin-emmc marvell/armada-3720-espressobin-v7 marvell/armada-3720-espressobin-v7-emmc" +BR2_LINUX_KERNEL_INSTALL_TARGET=y + +# Filesystem +BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the Marvell ESPRESSObin" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +BR2_TARGET_ROOTFS_TAR_GZIP=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/globalscale/espressobin/genimage.cfg"