From 440bca33aaeb7ed453948c933eaaef42e2eb0f6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 28 Jul 2015 22:42:45 +0200 Subject: [PATCH] Add external scripts and set boot configuration --- conf.py | 4 +- measure_scripts/11-patch | 9 ++ measure_scripts/20-config | 71 ++++++++++ measure_scripts/30-compile | 12 ++ measure_scripts/my-oldconfig.pl | 12 ++ measure_scripts/shark-ryu-board-patch.patch | 139 ++++++++++++++++++++ 6 files changed, 245 insertions(+), 2 deletions(-) create mode 100755 measure_scripts/11-patch create mode 100755 measure_scripts/20-config create mode 100755 measure_scripts/30-compile create mode 100755 measure_scripts/my-oldconfig.pl create mode 100644 measure_scripts/shark-ryu-board-patch.patch diff --git a/conf.py b/conf.py index 80c4008..f9f8932 100644 --- a/conf.py +++ b/conf.py @@ -14,7 +14,7 @@ kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kern linux_make_args = ['-j8'] # build_command # Command executed for kernel build in linux folder. -build_command = ['make'] + linux_make_args +build_command = ['measure_scripts/30-compile'] # novaboot_args # These are arguments passed to Novaboot, @@ -25,7 +25,7 @@ novaboot_args = ['--qemu=qemu-system-x86_64'] nbscript = 'scripts/nbscript' # boot_command # Command executed for booting. Output of this command is saved to output folder. -boot_command = ['echo', 'bootit'] +boot_command = ['scripts/nbscript'] # parse_command # Command to parse double value from boot output diff --git a/measure_scripts/11-patch b/measure_scripts/11-patch new file mode 100755 index 0000000..d29976e --- /dev/null +++ b/measure_scripts/11-patch @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +cd ../linux + +git reset --hard + +git apply --index < ../other_scripts/shark-ryu-board-patch.patch diff --git a/measure_scripts/20-config b/measure_scripts/20-config new file mode 100755 index 0000000..707b318 --- /dev/null +++ b/measure_scripts/20-config @@ -0,0 +1,71 @@ +#!/bin/sh + +set -e + +cd ../linux + +export ARCH=powerpc +make allnoconfig + +conf() { + sed -i -n -e "/\\bCONFIG_$1\\b/!p" .config + echo CONFIG_$1=$2 >> .config +} + +GDESC=$(git describe) +if [ ${GDESC#v2.6} != ${GDESC} ]; then + conf PPC_DISABLE_WERROR y +fi + +conf BINFMT_ELF y + +conf BLK_DEV_INITRD y +conf INITRAMFS_SOURCE '""' +conf INITRAMFS_ROOT_UID 0 +conf INITRAMFS_ROOT_GID 0 +conf INITRAMFS_COMPRESSION_NONE y +conf INITRAMFS_COMPRESSION_GZIP n +conf INITRAMFS_COMPRESSION_BZIP2 n +conf INITRAMFS_COMPRESSION_LZMA n +conf INITRAMFS_COMPRESSION_XZ n +conf INITRAMFS_COMPRESSION_LZO n +conf RD_GZIP y # Needed for 3.17+ +conf SIGNALFD y # Needed since v3.17-5503-g35a9ad8 to enable ANON_INODES (only needed until the problem http://mid.gmane.org/87vbnt1js4.fsf@steelpick.2x.cz is fixed) + +conf PPC_MPC52xx y +conf PPC_MPC5200_SIMPLE y +conf SERIAL_CORE y +conf SERIAL_CORE_CONSOLE y +conf SERIAL_MPC52xx y +conf SERIAL_MPC52xx_CONSOLE y +conf SERIAL_MPC52xx_CONSOLE_BAUD 115200 + +conf NET y +conf CAN y +conf CAN_RAW y +conf CAN_GW y +conf CAN_VCAN y +conf CAN_DEV y +conf CAN_CALC_BITTIMING y +conf CAN_MSCAN y +conf CAN_MPC5XXX y + +conf NETDEVICES y +conf ETHERNET y +conf DMADEVICES y +conf PPC_BESTCOMM y +conf NET_VENDOR_FREESCALE y +conf FEC_MPC52xx y +conf FEC_MPC52xx_MDIO y + +conf TTY y +conf PROC_FS y +conf PRINTK y # Not needed but useful for debugging + +# To have netlink for kernel cangw +conf INET y +conf NETFILTER y + +conf PACKET y # ugw mmap + +chronic ../other_scripts/my-oldconfig.pl diff --git a/measure_scripts/30-compile b/measure_scripts/30-compile new file mode 100755 index 0000000..29da38a --- /dev/null +++ b/measure_scripts/30-compile @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +cd ../linux + +export ARCH=powerpc +export CROSS_COMPILE=/opt/OSELAS.Toolchain-2012.12.1/powerpc-603e-linux-gnu/gcc-4.7.2-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/powerpc-603e-linux-gnu- + +test -t 0 || CHRONIC=chronic + +$CHRONIC make -j$(nproc) uImage diff --git a/measure_scripts/my-oldconfig.pl b/measure_scripts/my-oldconfig.pl new file mode 100755 index 0000000..736bf57 --- /dev/null +++ b/measure_scripts/my-oldconfig.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +use Expect; +my $exp = Expect->spawn("make oldconfig") + or die "Cannot spawn make oldconfig: $!\n"; + +my $timeout = 10; +$exp->expect($timeout, + [ '^ *choice\[.*\]: ' => sub { $exp->send("\n"); exp_continue; } ], + [ '^([^ ]| *[^>0-9]).*\(NEW\) ' => sub { $exp->send("n\n"); exp_continue; } ], + [ "configuration written to .config" ], + ) || die "Timeout" diff --git a/measure_scripts/shark-ryu-board-patch.patch b/measure_scripts/shark-ryu-board-patch.patch new file mode 100644 index 0000000..e43e35d --- /dev/null +++ b/measure_scripts/shark-ryu-board-patch.patch @@ -0,0 +1,139 @@ +From 87a8e2b9406cc7f8779f02047e0cd1594c570b78 Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Thu, 23 Jan 2014 23:44:55 +0100 +Subject: [PATCH] Shark/ryu board patch + +This is a new version of the patch. It is not based on historical patches +from Michal Hrouda, but on mpc5200_simple. It boots, serial line and +Ethernet work. I haven't check whether flash works. +--- + arch/powerpc/boot/dts/shark-ryu.dts | 104 +++++++++++++++++++++++++++ + arch/powerpc/platforms/52xx/mpc5200_simple.c | 1 + + 2 files changed, 105 insertions(+) + create mode 100644 arch/powerpc/boot/dts/shark-ryu.dts + +diff --git a/arch/powerpc/boot/dts/shark-ryu.dts b/arch/powerpc/boot/dts/shark-ryu.dts +new file mode 100644 +index 0000000..63e48a8 +--- /dev/null ++++ b/arch/powerpc/boot/dts/shark-ryu.dts +@@ -0,0 +1,104 @@ ++/* ++ * Shark(MPC5200) board Device Tree Source ++ * ++ * Copyright 2006-2007 Secret Lab Technologies Ltd. ++ * Grant Likely ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; either version 2 of the License, or (at your ++ * option) any later version. ++ */ ++ ++/include/ "mpc5200b.dtsi" ++ ++/ { ++ model = "cvut,ryu"; ++ compatible = "midam,shark"; ++ ++ memory { ++ reg = <0x00000000 0x08000000>; // 128MB ++ }; ++ ++ soc: soc5200@f0000000 { ++ psc@2000 { // PSC1 ++ compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; ++ }; ++ psc5: psc@2800 { // PSC5 ++ status = "disabled"; ++ }; ++ ++ ethernet@3000 { ++ phy-handle = <&phy0>; ++ }; ++ ++ mdio@3000 { ++ phy0: ethernet-phy@1f { ++ device_type = "ethernet-phy"; ++ reg = <0x1f>; ++ }; ++ }; ++ ++ i2c@3d40 { ++ rtc@68 { ++ compatible = "dallas,ds1307"; ++ reg = <0x68>; ++ }; ++ }; ++ }; ++ ++ localbus { ++ ranges = <0 0 0xfc000000 0x04000000>; ++ ++ flash@0,0 { ++ compatible = "cfi-flash"; ++ reg = <0 0 0x04000000>; ++ bank-width = <2>; ++ device-width = <2>; ++ #size-cells = <1>; ++ #address-cells = <1>; ++ ++ uboot@0 { ++ label = "u-boot"; ++ reg = <0 0x00100000>; ++ read-only; ++ }; ++ ++ kernel@100000 { ++ label = "kernel"; ++ reg = <0x00100000 0x00300000>; ++ read-only; ++ }; ++ ++ filesystem@400000 { ++ label = "filesystem"; ++ reg = <0x00400000 0x03c00000>; ++ }; ++ }; ++ }; ++ ++ pci: pci@f0000d00 { ++ interrupt-map-mask = <0xf800 0 0 7>; ++ interrupt-map = <0xc000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot ++ 0xc000 0 0 2 &mpc5200_pic 1 1 3 ++ 0xc000 0 0 3 &mpc5200_pic 1 2 3 ++ 0xc000 0 0 4 &mpc5200_pic 1 3 3 ++ ++ 0xc800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot ++ 0xc800 0 0 2 &mpc5200_pic 1 2 3 ++ 0xc800 0 0 3 &mpc5200_pic 1 3 3 ++ 0xc800 0 0 4 &mpc5200_pic 0 0 3>; ++ ranges = <0x42000000 0 0x80000000 0x80000000 0 0x20000000 ++ 0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 ++ 0x01000000 0 0x00000000 0xb0000000 0 0x01000000>; ++ }; ++ motorek@0 { ++ device_type = "motorek"; ++ pwmf = <&gpt2>; ++ pwmb = <&gpt3>; ++ irca = <&gpt5>; ++ ircb = <&gpt4>; ++ interrupts = <0 0 1>; ++ //gpios = <&gpio_a ++ }; ++}; +diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c +index 792a301..82aaa6e 100644 +--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c ++++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c +@@ -62,6 +62,7 @@ static const char *board[] __initdata = { + "promess,motionpro", + "schindler,cm5200", + "tqc,tqm5200", ++ "midam,shark", + NULL + }; + +-- +1.8.5.2 + -- 2.39.2