[OpenWrt-Devel] [PATCH 2/2 v4] linux: add support of Synopsys ARC770-based boards

Jonas Gorski jogo at openwrt.org
Tue Nov 10 06:02:04 EST 2015


Hi Alexey,

On Sat, Nov 7, 2015 at 2:25 PM, Alexey Brodkin
<Alexey.Brodkin at synopsys.com> wrote:
> This patch introduces support of new boards with ARC cores.
>
>  [1] Synopsys SDP board
>      This is a new-generation development board from Synopsys that
>      consists of base-board and CPU tile-board (which might have a real
>      ASIC or FPGA with CPU image).
>      It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
>      etc and is intended to be used for early development of ARC-based
>      products.
>
>  [2] nSIM
>      This is a virtual board implemented in Synopsys proprietary
>      software simulator (even though available for free for open source
>      community). This board has only serial port as a peripheral and so
>      it is meant to be used for runtime testing which is especially
>      useful during bring-up of new tools and platforms.
>      What's also important ARC cores are very configurable so there're
>      many variations of options like cache sizes, their line lengths,
>      additional hardware blocks like multipliers, dividers etc. And this
>      board could be used to make sure built software still runs on
>      different HW configurations.
>
> Cc: Felix Fietkau <nbd at openwrt.org>
> Cc: Jo-Philipp Wich <jow at openwrt.org>
> Cc: Jonas Gorski <jogo at openwrt.org>
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> ---
>
> Changes compared to v3:
>  * Accomodate new KERNEL_INITRAMFS_NAME variable for building .elfs
>  * Add and use "model" property in device tree description
>  * Remove extra console from kernel command line
>  * Use new buildsystem for resulting images
>  * Nuked ARC-specific inittab, use default one instead
>  * Linux kernel config is passed through "make kernel_oldconfig"
>  * eth0 is now LAN instead of WAN
>
> Changes compared to v2:
>  * Fixed copyright dates
>  * Cleaned-up init scripts
>
> Changes compared to v1:
>  * Switched to SoC-centered design. Now instead of common ARC700
>    support we claim support of boards based on ARC770D.
>    This allows to use the same one build of kernel binary for both
>    boards.
>
>  * Implemented run-time scripts that parse Device Tree compatible
>    tag and according to it do configuration of serial port and network.
>
>  * Implemented ability to patch in built Linux kernel external .dtb
>
>  * Linux kernel switched from 4.1 to 4.3
>
>  * Rebased on current master
>
>  include/kernel.mk                                  |   2 +
>  target/linux/arc770/Makefile                       |  26 +++
>  target/linux/arc770/base-files.mk                  |   3 +
>  .../arc770/base-files/etc/uci-defaults/02_network  |  23 +++
>  target/linux/arc770/base-files/lib/arc.sh          |  49 +++++
>  .../base-files/lib/preinit/01_preinit_arc.sh       |   9 +
>  target/linux/arc770/config-4.3                     | 179 ++++++++++++++++
>  target/linux/arc770/dts/axc001.dtsi                | 100 +++++++++
>  target/linux/arc770/dts/axs101.dts                 |  22 ++
>  target/linux/arc770/dts/axs10x_mb.dtsi             | 224 +++++++++++++++++++++
>  target/linux/arc770/dts/nsim_700.dts               |  71 +++++++
>  target/linux/arc770/dts/skeleton.dtsi              |  37 ++++
>  target/linux/arc770/generic/profiles/00-default.mk |  16 ++
>  target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
>  target/linux/arc770/generic/profiles/02-axs101.mk  |  17 ++
>  .../linux/arc770/generic/profiles/03-nsim_700.mk   |  16 ++
>  target/linux/arc770/generic/target.mk              |   8 +
>  target/linux/arc770/image/Makefile                 |  40 ++++
>  ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 ++++
>  .../0002-openwrt-arc-add-OWRTDTB-section.patch     |  91 +++++++++
>  20 files changed, 984 insertions(+)
>  create mode 100644 target/linux/arc770/Makefile
>  create mode 100644 target/linux/arc770/base-files.mk
>  create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
>  create mode 100644 target/linux/arc770/base-files/lib/arc.sh
>  create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
>  create mode 100644 target/linux/arc770/config-4.3
>  create mode 100644 target/linux/arc770/dts/axc001.dtsi
>  create mode 100644 target/linux/arc770/dts/axs101.dts
>  create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
>  create mode 100644 target/linux/arc770/dts/nsim_700.dts
>  create mode 100644 target/linux/arc770/dts/skeleton.dtsi
>  create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
>  create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
>  create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
>  create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
>  create mode 100644 target/linux/arc770/generic/target.mk
>  create mode 100644 target/linux/arc770/image/Makefile
>  create mode 100644 target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
>  create mode 100644 target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch

(snip)

> diff --git a/target/linux/arc770/base-files/lib/arc.sh b/target/linux/arc770/base-files/lib/arc.sh
> new file mode 100644
> index 0000000..17ce657
> --- /dev/null
> +++ b/target/linux/arc770/base-files/lib/arc.sh
> @@ -0,0 +1,49 @@
> +#!/bin/sh
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +
> +# defaults
> +ARC_BOARD_NAME="generic"
> +ARC_BOARD_MODEL="Generic ARC board"
> +
> +arc_board_detect() {
> +       local board
> +       local model
> +
> +       [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
> +
> +       model="$( cat /proc/device-tree/model )"
> +
> +       # Extract just one "compatible" value out of "snps,axs101snps,arc-sdp"
> +       # which is a concatenation of "snps,axs101" and "snps,arc-sdp".
> +       if cat /proc/device-tree/compatible | grep -q "snps,arc-sdp"; then
> +               board="arc-sdp";
> +       fi
> +
> +       if cat /proc/device-tree/compatible | grep -q "snps,nsim"; then
> +               board="nsim";
> +       fi

I guess I wasn't clear enough, the idea of using the model property is
so that you can then just do

case "$model" in
"Synopsys AXS101 Development Board";)
        board="arc-sdp";
        ;;
"Synopsys ARC770 nSIM simulator")
        board="nsim";
        ;;
esac

instead of grepping through compatible, which has the different
compatibles concatenated, thus
the potential of false positives.

> +
> +       if [ "$board" != "" ]; then
> +               ARC_BOARD_NAME="$board"
> +       fi
> +
> +       if [ "$model" != "" ]; then
> +               ARC_BOARD_MODEL="$model"
> +       fi
> +
> +       echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name
> +       echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model
> +       echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL"
> +}
> +
> +arc_board_name() {
> +       local name
> +
> +       [ -f /tmp/sysinfo/board_name ] && name="$(cat /tmp/sysinfo/board_name)"
> +       [ -z "$name" ] && name="unknown"
> +
> +       echo "$name"
> +}
> +

(snip)

> diff --git a/target/linux/arc770/generic/profiles/02-axs101.mk b/target/linux/arc770/generic/profiles/02-axs101.mk
> new file mode 100644
> index 0000000..42effd2
> --- /dev/null
> +++ b/target/linux/arc770/generic/profiles/02-axs101.mk
> @@ -0,0 +1,17 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/axs101
> +       NAME:=Synopsys DesignWare AXS101
> +       PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
> +       DTS := axs101

What's the point of th DTS variable? It's already defined for the
Device definition, and I don't see any code referencing it.

> +endef
> +
> +define Profile/axs101/Description
> +       Package set compatible with hardware using Synopsys DesignWare AXS101 boards.
> +endef
> +$(eval $(call Profile,axs101))
> diff --git a/target/linux/arc770/generic/profiles/03-nsim_700.mk b/target/linux/arc770/generic/profiles/03-nsim_700.mk
> new file mode 100644
> index 0000000..c1ba459
> --- /dev/null
> +++ b/target/linux/arc770/generic/profiles/03-nsim_700.mk
> @@ -0,0 +1,16 @@
> +#
> +# Copyright (C) 2015 OpenWrt.org
> +#
> +# This is free software, licensed under the GNU General Public License v2.
> +# See /LICENSE for more information.
> +#
> +
> +define Profile/nsim_700
> +       NAME:=Synopsys nSIM
> +       DTS := nsim_700

Same here.

> +endef
> +
> +define Profile/nsim_700/Description
> +       Package set compatible with hardware using Synopsys nSIM 700 boards.
> +endef
> +$(eval $(call Profile,nsim_700))


Jonas
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list