Skip to content
Snippets Groups Projects
Commit 5019e710 authored by joachim.schmidt's avatar joachim.schmidt
Browse files

Edit sja1105-init. Added sja1105-conf.

parent f33cf5e1
No related branches found
No related tags found
No related merge requests found
Showing
with 351 additions and 131 deletions
PETALINUX_VER=2020.2 PETALINUX_VER=2020.2
VALIDATE_HW_CHKSUM=1 VALIDATE_HW_CHKSUM=1
HARDWARE_PATH=/home/jo/Documents/Projets/Hepia/scalp_project/scalp_firmware/designs/vivado/scalp_safe_firmware/2020.2/lin64/scalp_safe_firmware/scalp_safe_firmware.xsa HARDWARE_PATH=/home/jo/Documents/Projets/Hepia/scalp_project/scalp_firmware/designs/vivado/scalp_safe_firmware/2020.2/lin64/scalp_safe_firmware/scalp_safe_firmware.xsa
HARDWARE_CHECKSUM=c0e54849f94ffc5aaa53e1cad4e1235f HARDWARE_CHECKSUM=e4c86ebb7157c318baafe6ea2691035e
YOCTO_SDK=5ff8fc5f85d1566b314bb73eaa378212 YOCTO_SDK=5ff8fc5f85d1566b314bb73eaa378212
RFSCONFIG_CHKSUM=269e3949c0bcc4ef769c74fd4481e933 RFSCONFIG_CHKSUM=098862acb0a15bbc6a0d0999eb493baa
...@@ -195,7 +195,7 @@ CONFIG_SUBSYSTEM_EXTRA_DT_FILES="" ...@@ -195,7 +195,7 @@ CONFIG_SUBSYSTEM_EXTRA_DT_FILES=""
# #
CONFIG_SUBSYSTEM_BOOTARGS_AUTO=y CONFIG_SUBSYSTEM_BOOTARGS_AUTO=y
CONFIG_SUBSYSTEM_BOOTARGS_EARLYPRINTK=y CONFIG_SUBSYSTEM_BOOTARGS_EARLYPRINTK=y
CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyPS0,115200 earlycon"
CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@" CONFIG_SUBSYSTEM_DEVICETREE_COMPILER_FLAGS="-@"
# CONFIG_SUBSYSTEM_DTB_OVERLAY is not set # CONFIG_SUBSYSTEM_DTB_OVERLAY is not set
# CONFIG_SUBSYSTEM_REMOVE_PL_DTB is not set # CONFIG_SUBSYSTEM_REMOVE_PL_DTB is not set
...@@ -290,4 +290,3 @@ CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/r ...@@ -290,4 +290,3 @@ CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/r
# User Layers # User Layers
# #
CONFIG_USER_LAYER_0="" CONFIG_USER_LAYER_0=""
CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="console=ttyPS0,115200 earlycon"
...@@ -4024,6 +4024,7 @@ CONFIG_imagefeature-debug-tweaks=y ...@@ -4024,6 +4024,7 @@ CONFIG_imagefeature-debug-tweaks=y
# #
# CONFIG_gpio-demo is not set # CONFIG_gpio-demo is not set
# CONFIG_peekpoke is not set # CONFIG_peekpoke is not set
CONFIG_sja1105-conf=y
CONFIG_sja1105-init=y CONFIG_sja1105-init=y
# #
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define CONFIG_MII #define CONFIG_MII
#define CONFIG_NET_MULTI #define CONFIG_NET_MULTI
#define CONFIG_NETCONSOLE 1 #define CONFIG_NETCONSOLE 1
#define CONFIG_SERVERIP 10.136.135.67 #define CONFIG_SERVERIP 192.168.1.153
#define CONFIG_IPADDR 192.168.0.10 #define CONFIG_IPADDR 192.168.0.10
#define CONFIG_GATEWAYIP 192.168.0.1 #define CONFIG_GATEWAYIP 192.168.0.1
#define CONFIG_NETMASK 255.255.255.0 #define CONFIG_NETMASK 255.255.255.0
......
No preview for this file type
No preview for this file type
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
CONFIG_gpio-demo CONFIG_gpio-demo
CONFIG_peekpoke CONFIG_peekpoke
CONFIG_sja1105-init CONFIG_sja1105-init
CONFIG_sja1105-conf
# Load the PetaLinux SDK main gdbinit script
source plnx_gdbinit
PetaLinux User Application Template
===================================
This directory contains a PetaLinux user application created from a template.
You can easily import any already built application or script by copying
it into this directory, and editing the automatically generated Makefile
as described below.
Modify the "install:" target in Makefile to use $(TARGETINST) to install your
prebuilt application or script to the host copy of the target file system
referring to the comments of the "install:" target.
Before building the application, you will need to enable the application
from PetaLinux menuconfig by running:
"petalinux-config -c rootfs"
You will see your application in the "apps --->" submenu.
To install your prebuilt application or script to the target file system
copy on the host, simply run the command.
"petalinux-build -c rootfs/sja1105-conf"
You will also need to rebuild PetaLinux bootable images so that the images
is updated with the updated target filesystem copy, run this command:
"petalinux-build -c rootfs"
You can also run one PetaLinux command to install the application to the
target filesystem host copy and update the bootable images as follows:
"petalinux-build"
#!/bin/sh
sja1105_ports_link_up()
{
echo "[INFO] sja1105-conf : sja1105 ports linking up..."
ip link set swp0_east up
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : swp0_east port is up."
else
exit 1
fi
ip link set swp2_bottom up
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : swp2_bottom port is up."
else
exit 1
fi
ip link set swp3_top up
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : swp3_top port is up."
else
exit 1
fi
ip link set swp4_west up
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : swp4_west port is up."
else
exit 1
fi
echo "[INFO] sja1105-conf : sja1105 ports linked up."
}
sja1105_creat_bridge()
{
echo "[INFO] sja1105-conf : Creation and configuration of the bridge in progress..."
ip link add name br0 type bridge
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Added a new bridge-like interface."
else
exit 1
fi
ip link set dev br0 type bridge vlan_filtering 1
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the bridge interface in VLAN filtering mode."
else
exit 1
fi
echo "[INFO] sja1105-conf : Creation and configuration of the bridge is done."
}
sja1105_link_ports_to_bridge()
{
echo "[INFO] sja1105-conf : sja1105 ports are being attached to the bridge..."
ip link set dev swp0_east master br0
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Addition of the swp0_east interface to the bridge interface."
else
exit 1
fi
ip link set dev swp2_bottom master br0
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Addition of the swp2_bottom interface to the bridge interface."
else
exit 1
fi
ip link set dev swp3_top master br0
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Addition of the swp3_top interface to the bridge interface."
else
exit 1
fi
ip link set dev swp4_west master br0
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Addition of the swp4_west interface to the bridge interface."
else
exit 1
fi
echo "[INFO] sja1105-conf : sja1105 ports are attached to the bridge."
}
sja1105_ports_vlan_conf()
{
echo "[INFO] sja1105-conf : sja1105 ports VLAN configuration in progress..."
bridge vlan add dev swp0_east vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp0_east interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp2_bottom vid 2 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp2_bottom interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp3_top vid 3 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp3_top interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp4_west vid 4 pvid untagged
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : Configuration of the swp4_west interface in untagged VLAN mode."
else
exit 1
fi
echo "[INFO] sja1105-conf : sja1105 ports VLAN configuration is done."
}
sja1105_bridge_link_up()
{
echo "[INFO] sja1105-conf : sja1105 bridge linking up..."
ip link set br0 up
if [ "$?" -eq "0" ] ; then
echo "[INFO] sja1105-conf : bridge-like interface is up."
else
exit 1
fi
echo "[INFO] sja1105-conf : sja1105 bridge linked up."
}
sja1105_ports_link_up
sja1105_creat_bridge
sja1105_link_ports_to_bridge
sja1105_ports_vlan_conf
sja1105_bridge_link_up
# #
# This file is the sja1105-init recipe. # This file is the sja1105-conf recipe.
# #
SUMMARY = "Simple sja1105-init application" SUMMARY = "Simple sja1105-conf application"
SECTION = "PETALINUX/apps" SECTION = "PETALINUX/apps"
LICENSE = "MIT" LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://sja1105-init \ SRC_URI = "file://sja1105-conf \
" "
S = "${WORKDIR}" S = "${WORKDIR}"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
inherit update-rc.d
INITSCRIPT_NAME = "sja1105-init"
INITSCRIPT_PARAMS = "start 81 K ."
do_install() { do_install() {
install -d ${D}${sysconfdir}/init.d install -d ${D}/${bindir}
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/init.d/sja1105-init install -m 0755 ${S}/sja1105-conf ${D}/${bindir}
} }
FILES_${PN} += "${sysconfdir}/*"
#!/bin/sh #!/bin/sh
### BEGIN INIT INFO
echo "SJA1105 PetaLinux init script is running..." # Provides: sja1105-init
# Required-Start: $local_fs $network $named $time $syslog
ip link set swp0_east up # Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
if [ "$?" -eq "0" ] ; then # Default-Stop: 0 1 6
echo -e "[INFO] sja1105-init : swp0_east port is up." # Description: sja1105 init.d script configuration.
else ### END INIT INFO
exit 1
fi SCRIPT=sja1105-conf
RUNAS=root
ip link set swp2_bottom up
PIDFILE=/var/run/sja1105-init.pid
if [ "$?" -eq "0" ] ; then LOGFILE=/var/log/sja1105-init.log
echo -e "[INFO] sja1105-init : swp2_bottom port is up."
else start() {
exit 1 if [ -f /var/run/$PIDNAME ] && kill -0 $(cat /var/run/$PIDNAME); then
fi echo 'Service already running' >&2
return 1
ip link set swp3_top up fi
echo 'Starting service…' >&2
if [ "$?" -eq "0" ] ; then local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
echo -e "[INFO] sja1105-init : swp3_top port is up." su -c "$CMD" $RUNAS > "$PIDFILE"
else echo 'Service started' >&2
exit 1 }
fi
stop() {
ip link set swp4_west up if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
echo 'Service not running' >&2
if [ "$?" -eq "0" ] ; then return 1
echo -e "[INFO] sja1105-init : swp4_west port is up." fi
else echo 'Stopping service…' >&2
exit 1 kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
fi echo 'Service stopped' >&2
}
ip link add name br0 type bridge
case "$1" in
if [ "$?" -eq "0" ] ; then start)
echo -e "[INFO] sja1105-init : Added a new bridge-like interface." start
else ;;
exit 1 stop)
fi stop
;;
ip link set dev br0 type bridge vlan_filtering 1 retart)
stop
if [ "$?" -eq "0" ] ; then start
echo -e "[INFO] sja1105-init : Configuration of the bridge interface in VLAN filtering mode." ;;
else *)
exit 1 echo "Usage: $0 {start|stop|restart|uninstall}"
fi esac
ip link set dev swp0_east master br0
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Addition of the swp0_east interface to the bridge interface."
else
exit 1
fi
ip link set dev swp2_bottom master br0
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Addition of the swp2_bottom interface to the bridge interface."
else
exit 1
fi
ip link set dev swp3_top master br0
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Addition of the swp3_top interface to the bridge interface."
else
exit 1
fi
ip link set dev swp4_west master br0
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Addition of the swp4_west interface to the bridge interface."
else
exit 1
fi
bridge vlan add dev swp0_east vid 1 pvid untagged
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Configuration of the swp0_east interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp2_bottom vid 2 pvid untagged
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Configuration of the swp2_bottom interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp3_top vid 3 pvid untagged
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Configuration of the swp3_top interface in untagged VLAN mode."
else
exit 1
fi
bridge vlan add dev swp4_west vid 4 pvid untagged
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : Configuration of the swp4_west interface in untagged VLAN mode."
else
exit 1
fi
ip link set br0 up
if [ "$?" -eq "0" ] ; then
echo -e "[INFO] sja1105-init : bridge-like interface is up."
else
exit 1
fi
...@@ -18,13 +18,19 @@ inherit update-rc.d ...@@ -18,13 +18,19 @@ inherit update-rc.d
INITSCRIPT_NAME = "sja1105-init" INITSCRIPT_NAME = "sja1105-init"
INITSCRIPT_PARAMS = "start 99 S ." INITSCRIPT_PARAMS = "start 02 S ."
do_install() { do_install() {
install -d ${D}${sysconfdir}/init.d install -d ${D}${sysconfdir}/init.d
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/init.d/sja1105-init install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/init.d/sja1105-init
install -d ${D}${sysconfdir}/rcS.d install -d ${D}${sysconfdir}/rc2.d
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/rcS.d/S99sja1105-init install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/rc2.d/S02sja1105-init
install -d ${D}${sysconfdir}/rc3.d
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/rc3.d/S02sja1105-init
install -d ${D}${sysconfdir}/rc4.d
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/rc4.d/S02sja1105-init
install -d ${D}${sysconfdir}/rc5.d
install -m 0755 ${S}/sja1105-init ${D}${sysconfdir}/rc5.d/S02sja1105-init
} }
FILES_${PN} += "${sysconfdir}/*" FILES_${PN} += "${sysconfdir}/*"
CONFIG_API=y
CONFIG_QSPI_BOOT=y
CONFIG_SPI_BOOT=y
CONFIG_LOG=y
# CONFIG_SPL_LOG is not set
# CONFIG_TPL_LOG is not set
CONFIG_LOG_MAX_LEVEL=5
CONFIG_LOG_CONSOLE=y
# CONFIG_LOG_TEST is not set
# CONFIG_LOG_ERROR_RETURN is not set
CONFIG_SYS_PROMPT="ScalpZynq> "
CONFIG_BUILD_BIN2C=y
CONFIG_CMD_CONFIG=y
CONFIG_CMD_LICENSE=y
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
CONFIG_CMD_GREPENV=y
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_ENV_FLAGS=y
CONFIG_CMD_NVEDIT_INFO=y
CONFIG_CMD_EEPROM=y
CONFIG_CMD_EEPROM_LAYOUT=y
CONFIG_EEPROM_LAYOUT_HELP_STRING="<not defined>"
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MX_CYCLIC=y
CONFIG_CMD_FPGA_LOAD_SECURE=y
CONFIG_CMD_MTD=y
CONFIG_CMD_SETEXPR=y
CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFS=y
# CONFIG_ENV_IS_IN_UBI is not set
CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0xfa
CONFIG_SYS_I2C_EEPROM_ADDR=0x53
CONFIG_MTD_PARTITIONS=y
CONFIG_SPI_FLASH_MTD=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
# CONFIG_MTD_UBI_FASTMAP is not set
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_ZYNQ_SPI=y
CONFIG_ZYNQ_QSPI=y
CONFIG_RGMII=y
CONFIG_FS_JFFS2=y
CONFIG_RBTREE=y
CONFIG_LZO=y
CONFIG_ENV_OFFSET=0x0
CONFIG_ENV_ADDR=0x500000
CONFIG_XILINX_OF_BOARD_DTB_ADDR=0x520000
CONFIG_PACKING=y
CONFIG_CMD_SJA1105=y
CONFIG_SCALP_SJA1105=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_FULL=y
CONFIG_PINCTRL_GENERIC=y
CONFIG_PINMUX=y
# CONFIG_PINCONF is not set
CONFIG_PINCONF_RECURSIVE=y
# CONFIG_PINCTRL_AT91 is not set
# CONFIG_PINCTRL_AT91PIO4 is not set
# CONFIG_PINCTRL_ROCKCHIP_RV1108 is not set
# CONFIG_PINCTRL_SINGLE is not set
# CONFIG_PINCTRL_STM32 is not set
# CONFIG_PINCTRL_STMFX is not set
CONFIG_DEFAULT_DEVICE_TREE="zynq-scalp"
# CONFIG_OF_SEPARATE is not set
CONFIG_OF_EMBED=y
CONFIG_DM_MDIO=y
CONFIG_DM_MDIO_MUX=y
# CONFIG_MDIO_MUX_I2CREG is not set
# CONFIG_MVMDIO is not set
\ No newline at end of file
...@@ -3,7 +3,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" ...@@ -3,7 +3,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://platform-top.h \ SRC_URI += "file://platform-top.h \
file://devtool-fragment.cfg \ file://devtool-fragment.cfg \
" "
SRC_URI += "file://scalp_uboot.cfg"
SRC_URI += "file://u-boot-setexpt.patch" SRC_URI += "file://u-boot-setexpt.patch"
SRC_URI += "file://u-boot-scalp-sja1105.patch" SRC_URI += "file://u-boot-scalp-sja1105.patch"
SRC_URI += "file://u-boot-zynq-scalp-dts.patch" SRC_URI += "file://u-boot-zynq-scalp-dts.patch"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment