]> rtime.felk.cvut.cz Git - fpga/zynq/canbench-sw.git/commitdiff
petalinux: added scripts
authorMartin Jerabek <jerabma7@fel.cvut.cz>
Fri, 27 May 2016 06:43:41 +0000 (08:43 +0200)
committerMartin Jerabek <jerabma7@fel.cvut.cz>
Fri, 27 May 2016 06:43:41 +0000 (08:43 +0200)
petalinux/components/generic/scripts/Kconfig [new file with mode: 0644]
petalinux/components/generic/scripts/Makefile [new file with mode: 0644]
petalinux/components/generic/scripts/caninit [new file with mode: 0755]
petalinux/components/generic/scripts/lsrt [new file with mode: 0755]
petalinux/components/generic/scripts/upbit [new file with mode: 0755]
petalinux/mkbootscript [deleted file]
petalinux/subsystems/linux/config

diff --git a/petalinux/components/generic/scripts/Kconfig b/petalinux/components/generic/scripts/Kconfig
new file mode 100644 (file)
index 0000000..1850d83
--- /dev/null
@@ -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 (file)
index 0000000..9835f9e
--- /dev/null
@@ -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 (executable)
index 0000000..8c87aa2
--- /dev/null
@@ -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 (executable)
index 0000000..6916501
--- /dev/null
@@ -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 (executable)
index 0000000..872a610
--- /dev/null
@@ -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 (executable)
index 103310f..0000000
+++ /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
index 6bee6553178d1730937517fa36335a4c8afb1d02..6370fd4631eb5a95c4d7a71b5f81c42fcf723836 100644 (file)
@@ -21,6 +21,7 @@ CONFIG_SUBSYSTEM_COMPONENT_ROOTFS_NAME_PETALINUX__ROOTFS=y
 #
 # Generic Components
 #
+CONFIG_SUBSYSTEM_COMPONENT_GENERIC_NAME_SCRIPTS=y
 
 #
 # Auto Config Settings