From: Martin Jerabek Date: Fri, 27 May 2016 06:43:41 +0000 (+0200) Subject: petalinux: added scripts X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/zynq/canbench-sw.git/commitdiff_plain/f1fd587e397297cf76e87eb4b210017fdc2d7882 petalinux: added scripts --- diff --git a/petalinux/components/generic/scripts/Kconfig b/petalinux/components/generic/scripts/Kconfig new file mode 100644 index 0000000..1850d83 --- /dev/null +++ b/petalinux/components/generic/scripts/Kconfig @@ -0,0 +1,14 @@ +############################################################################### +# Please modify this file if you want to configure your own generic component. +# You can uncommon and/or change the following Kconfig elements. +############################################################################### + + +if GENERIC_SCRIPTS + comment "No additional options for SCRIPTS" + +# config GENERIC_SCRIPTS_OPTION0 +# bool "option0" +# help +# Help text +endif diff --git a/petalinux/components/generic/scripts/Makefile b/petalinux/components/generic/scripts/Makefile new file mode 100644 index 0000000..9835f9e --- /dev/null +++ b/petalinux/components/generic/scripts/Makefile @@ -0,0 +1,28 @@ +ifndef PETALINUX +$(error "Error: PETALINUX environment variable not set. Change to the root of your PetaLinux install, and source the settings.sh file") +endif + +include generic.common.mk + +FILES := caninit lsrt upbit + +.PHONY: all build pre-build post-build install pre-install post-install config clean +all: build + +build: + +pre-build: + +post-build: + +install: + for f in $(FILES); do $(TARGETINST) -d /$$f ./$$f; done + +pre-install: + +post-install: + +config: + +clean: + diff --git a/petalinux/components/generic/scripts/caninit b/petalinux/components/generic/scripts/caninit new file mode 100755 index 0000000..8c87aa2 --- /dev/null +++ b/petalinux/components/generic/scripts/caninit @@ -0,0 +1,31 @@ +#!/bin/sh + +#devmem 0x43c20000 32 0 + +br=1000000 +#br=1000000 +#br=500000 +#br=250000 +#br=125000 +#br=62500 + +rmmod xilinx_can +rmmod sja1000_platform +modprobe xilinx_can +modprobe sja1000_platform +canconfig can0 bitrate $br +canconfig can1 bitrate $br +canconfig can2 bitrate $br +canconfig can3 bitrate $br +canconfig can0 start +canconfig can1 start +canconfig can2 start +canconfig can3 start + +modprobe uio_pdrv_genirq of_id=can-crossbar + +for pid in $(ps | grep -- -can | grep -v grep | awk '{print$1}') +do + chrt -r -p 99 $pid +done + diff --git a/petalinux/components/generic/scripts/lsrt b/petalinux/components/generic/scripts/lsrt new file mode 100755 index 0000000..6916501 --- /dev/null +++ b/petalinux/components/generic/scripts/lsrt @@ -0,0 +1,7 @@ +#!/bin/sh + +cd /proc +for f in [0-9]* +do + awk "{print \"$f\", \$2, \$40}"<$f/stat +done | sort -k3 diff --git a/petalinux/components/generic/scripts/upbit b/petalinux/components/generic/scripts/upbit new file mode 100755 index 0000000..872a610 --- /dev/null +++ b/petalinux/components/generic/scripts/upbit @@ -0,0 +1,3 @@ +#!/bin/sh + +zcat /system.bit.bin.gz >/dev/xdevcfg diff --git a/petalinux/mkbootscript b/petalinux/mkbootscript deleted file mode 100755 index 103310f..0000000 --- a/petalinux/mkbootscript +++ /dev/null @@ -1 +0,0 @@ -mkimage -A arm -O u-boot -T script -C none -a 0 -e 0 -n "t-Boot Script" -d bootscript.txt bootscript diff --git a/petalinux/subsystems/linux/config b/petalinux/subsystems/linux/config index 6bee655..6370fd4 100644 --- a/petalinux/subsystems/linux/config +++ b/petalinux/subsystems/linux/config @@ -21,6 +21,7 @@ CONFIG_SUBSYSTEM_COMPONENT_ROOTFS_NAME_PETALINUX__ROOTFS=y # # Generic Components # +CONFIG_SUBSYSTEM_COMPONENT_GENERIC_NAME_SCRIPTS=y # # Auto Config Settings