summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/platform_data/mtd-davinci-aemif.h
blob: 97948ac2bb9be9de784ad7f14e73602f8793e670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * TI DaVinci AEMIF support
 *
 * Copyright 2010 (C) Texas Instruments, Inc. http://www.ti.com/
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */
#ifndef _MACH_DAVINCI_AEMIF_H
#define _MACH_DAVINCI_AEMIF_H

#include <linux/platform_device.h>

#define NRCSR_OFFSET		0x00
#define AWCCR_OFFSET		0x04
#define A1CR_OFFSET		0x10

#define ACR_ASIZE_MASK		0x3
#define ACR_EW_MASK		BIT(30)
#define ACR_SS_MASK		BIT(31)

/* All timings in nanoseconds */
struct davinci_aemif_timing {
	u8	wsetup;
	u8	wstrobe;
	u8	whold;

	u8	rsetup;
	u8	rstrobe;
	u8	rhold;

	u8	ta;
};

int davinci_aemif_setup(struct platform_device *pdev);
#endif
ff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
heat_template_version: 2014-10-16
description: HOT template to deploy a virtual Traffic Classifier

parameters:
  default_net:
    type: string
  default_subnet:
    type: string
  source_net:
    type: string
  source_subnet:
    type: string
  destination_net:
    type: string
  destination_subnet:
    type: string
  timeout:
    type: number
    description: Timeout for WaitCondition, depends on your image and environment
    default: 2000

resources:
  wait_condition:
    type: OS::Heat::WaitCondition
    properties:
      handle: {get_resource: wait_handle}
      count: 1
      timeout: {get_param: timeout}

  wait_handle:
    type: OS::Heat::WaitConditionHandle

  ### DEFAULT NETWORK FOR MNGM
  port_1:
    type: OS::Neutron::Port
    properties:
      network: { get_param: default_net }
      binding:vnic_type: normal
      fixed_ips:
        - subnet: { get_param: default_subnet }

  ### NETWORK FOR RECEIVING TRAFFIC
  port_2:
    type: OS::Neutron::Port
    properties:
      network: { get_param: source_net }
      binding:vnic_type: #vnic_type
      fixed_ips:
        - subnet: { get_param: source_subnet }

  ### NETWORK FOR SENDING TRAFFIC
  port_3:
    type: OS::Neutron::Port
    properties:
      network: { get_param: destination_net }
      binding:vnic_type: #vnic_type
      fixed_ips:
        - subnet: { get_param: destination_subnet }

  server:
    type: OS::Nova::Server
    properties:
      name: vTC
      #key_name: { get_param: key_name }
      image: ubuntu1404
      user_data:
        str_replace:
          template: |
            #!/bin/sh
            # Creation of a user
            echo "Creating custom user..."
            useradd clouduser -g admin -s /bin/bash -m
            echo clouduser:yardstick | chpasswd
            echo "Enabling ssh password login..."
            sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
            service ssh restart
            sleep 1

            # wake up interfaces
            ifconfig eth1 up
            ifconfig eth2 up
            dhclient eth1
            dhclient eth2
            sed -i 's/localhost/localhost vtc/g' /etc/hosts

            # Install vTC Dependencies
            apt-get update
            apt-get install -y git build-essential gcc libnuma-dev bison flex byacc libjson0-dev libcurl4-gnutls-dev jq dh-autoreconf libpcap-dev libpulse-dev libtool pkg-config
            apt-get install -y byacc libtool libcurl4-openssl-dev

            cd /home/clouduser

            # Setup multicast
            echo mgroup from eth1 group 224.192.16.1 > /etc/smcroute.conf
            git clone https://github.com/troglobit/smcroute.git
            cd smcroute
            git reset --hard c3f5c56
            sed -i 's/aclocal-1.11/aclocal/g' ./autogen.sh
            sed -i 's/automake-1.11/automake/g' ./autogen.sh
            ./autogen.sh
            ./configure
            make
            make install
            cd ..
            touch multicast.sh
            echo "#!/bin/bash" > multicast.sh
            echo "while [ true ]" >> multicast.sh
            echo "do" >> multicast.sh
            echo "  smcroute -k" >> multicast.sh
            echo "  smcroute -d" >> multicast.sh
            echo "  sleep 50" >> multicast.sh
            echo "done" >> multicast.sh
            chmod +x multicast.sh
            ./multicast.sh &

            rm resp.json
            curl -X POST -u "mPkgwvJPsTFS8hYmHk:SDczcrK4cvnkMRWSEchB3ANcWbqFXqPx" https://bitbucket.org/site/oauth2/access_token -d grant_type=refresh_token -d refresh_token=38uFQuhEdPvCTbhc7k >> resp.json
            access_token=`jq -r '.access_token' resp.json`
            git clone https://x-token-auth:${access_token}@bitbucket.org/akiskourtis/vtc.git
            cd vtc
            git checkout -b stable
            #Build nDPI library
            cd nDPI
            NDPI_DIR=$(pwd)
            echo $NDPI_DIR
            NDPI_INCLUDE=$(pwd)/src/include
            echo $NDPI_INCLUDE
            ./autogen.sh
            ./configure
            make
            make install

            #Build PF_RING library
            cd ..
            cd PF_RING
            make
            #Build PF_RING examples, including the modified pfbridge, with nDPI integrated.
            cd userland/examples/
            sed -i 's#EXTRA_LIBS =#EXTRA_LIBS='"${NDPI_DIR}"'/src/lib/.libs/libndpi.a -ljson-c#' ./Makefile
            sed -i 's# -Ithird-party# -Ithird-party/ -I'"$NDPI_INCLUDE"' -I'"$NDPI_DIR"'#' ./Makefile
            echo $NDPI_DIR
            make
            cd ../..
            cd ..
            cd ..

            # To use PF_RING driver use the following
            #sudo rmmod pf_ring
            #insmod ./vtc/PF_RING/kernel/pf_ring.ko min_num_slots=16384 enable_debug=1 quick_mode=1 enable_tx_capture=0
            #./vtc/PF_RING/userland/examples/pfbridge -a eth1 -b eth2 &
            sleep 5

            # To use the Linux kernel driver use the following
            cd /home/clouduser/
            sudo nohup ./vtc/nDPI/example/ndpiReader -i eth1 -a eth2 &
            sleep 5

            curl --data-ascii "{\"classification_rules\":[{\"RuleId\":\"1\",\"ToS\":\"16\"}]}" http://localhost:9999/classifier/classification_rules/224.192.16.1 &
            wc_notify --data-binary '{"status": "SUCCESS"}'
          params:
            wc_notify: { get_attr: ['wait_handle', 'curl_cli'] }
            #$IP_FAMILY: { get_param: ip_family }
      flavor: #vtc_flavor
      networks:
        - port: { get_resource: port_1 }
        - port: { get_resource: port_2 }
        - port: { get_resource: port_3 }
outputs: