Hi Jonas, On Tue, 2015-11-10 at 12:02 +0100, Jonas Gorski wrote: > Hi Alexey, > > On Sat, Nov 7, 2015 at 2:25 PM, Alexey Brodkin > <[email protected]> wrote: > > This patch introduces support of new boards with ARC cores. > (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
Well my implementation was intentional. See we have 2 flavors of ARC SDP board: AXS101 and AXS103. They have the same base-board (where all peripherals really reside) and different CPU-cards: AXS101 sports CPU-card with ARC770-based ASIC; AXS103 sports CPU-card with ARC HS38 in FPGA. So I wanted to detect existence of ARC SDP base-board and then set say network interfaces according to available devices. And difference in CPU type is not important here because it has no impact on the board behavior. Makes any sense? > > > 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. Well I thought about it. Other SoCs and boards for some reason have different names for: 1) board 2) profile 3) .dts-file But in arc770 case I was able to align all of them so right that blindly copy-pasted thingy must go away. -Alexey _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
