on early-init
    write /sys/class/boot_monitor/boot_timer 1
    insmod /boot/otz_client.ko

on init

on aml-firstboot-init
    #show first init logo
    #display_logo /firstinitlogo.rle

    #format data and cache patrition if not exist

on post-fs-data

on boot
    write /sys/class/freq_limit/limit 0
#write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 816000
    #write /sys/devices/system/cpu/cpufreq/ondemand/freq_step 8
    #write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 100000
    #write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 80
    #write /sys/devices/system/cpu/cpufreq/ondemand/down_threshold 50
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_dflt_freq 1488000

    write /sys/class/vfm/map "rm default"
    write /sys/class/vfm/map "add default decoder ppmgr deinterlace amvideo"
    #write /sys/class/vfm/map "add default decoder ppmgr amvideo"

    chmod 0666 /dev/otz_client
    write /proc/sys/vm/mem_management_thresh 2048

#add for mali scaling mode set
    chown system /sys/module/mali/parameters/scaling_mode

on property:init.svc.bootanim=running
    write /sys/class/graphics/fb1/free_scale 0
    write /sys/class/graphics/fb0/free_scale 0x10001
    write /sys/class/graphics/fb0/blank 0
    write /sys/class/graphics/fb1/blank 1
    write /sys/class/graphics/fb2/blank 1
    write /sys/class/graphics/fb3/blank 1

on property:init.svc.bootanim=stopped
    start preinstall
#    write /sys/class/aml_mod/mod_off audio
    write /sys/class/aml_mod/mod_off mipi
#    write /sys/class/aml_mod/mod_off spi
#    write /sys/class/aml_mod/mod_off uart0
    write /sys/class/aml_mod/mod_off uart1
    write /sys/class/aml_mod/mod_off uart2
    write /sys/class/aml_mod/mod_off uart3
#    write /sys/class/aml_mod/mod_off venc
#   write /sys/class/aml_mod/mod_off hdmi
    write /sys/class/aml_mod/mod_off bt656
    write /sys/class/aml_mod/mod_off vdec
#    write /sys/class/aml_mod/mod_off rom
#    write /sys/class/aml_mod/mod_off efuse
    write /sys/class/aml_mod/mod_off random_num_gen
    write /sys/class/aml_mod/mod_off tcon
#    write /sys/class/aml_mod/mod_off ethernet
#    write /sys/class/aml_mod/mod_off media_cpu
   write /sys/class/aml_mod/mod_off viu2
#    write /sys/class/aml_mod/mod_off smart_card
    write /sys/class/aml_mod/mod_off sdhc
    write /sys/class/aml_mod/mod_off stream
    write /sys/class/aml_mod/mod_off blk_mov
    write /sys/class/aml_mod/mod_off dvin
#    write /sys/class/aml_mod/mod_off rdma
    write /sys/class/aml_mod/mod_off ge2d
#    write /sys/class/aml_mod/mod_off vdin
    write /sys/class/aml_mod/mod_off lvds

  # write /sys/class/aml_mod/dynamical_control audio
    write /sys/class/aml_mod/dynamical_control vdec
    write /sys/class/aml_mod/dynamical_control bt656
    #write /sys/class/aml_mod/dynamical_control venc
    #write /sys/class/aml_mod/dynamical_control media_cpu
    write /sys/class/aml_mod/dynamical_control ge2d
   #write /sys/class/aml_mod/dynamical_control vdin

    write /sys/class/boot_monitor/boot_timer 0
    write /sys/module/di/parameters/bypass_dynamic 1
    write /sys/module/di/parameters/bypass_hd_prog 0

    #write /sys/kernel/mm/ksm/pages_to_scan 100
    #write /sys/kernel/mm/ksm/sleep_millisecs 500
    #write /sys/kernel/mm/ksm/run 1

    write /sys/class/video/disable_video 2

service zram_mem /system/bin/zram_mount.sh
    class main
    oneshot

service wpa_supplicant /system/bin/wpa_supplicant \
    -iwlan0 -Dnl80211,wext -c/data/misc/wifi/wpa_supplicant.conf \
    -e/data/misc/wifi/entropy.bin \
    -O/data/misc/wifi/sockets \
    -g@android:wpa_wlan0
    #   we will start as root and wpa_supplicant will switch to user wifi
    #   after setting up the capabilities required for WEXT
    #   user wifi
    #   group wifi inet keystore
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

#service xcmidware /system/bin/xcmid-amlogic
#    class main
#    user root
#    group root system input

service preinstall /system/bin/preinstall.sh
    user root
    group root
    oneshot

service ups /system/bin/ups3.sh
    class core
    user root
    group root
    disabled
    oneshot

service makebootini /system/bin/makebootini.sh
    class core
    user root
    group root
    disabled
    oneshot

service rotation /system/bin/rotation.sh
    class core
    user root
    group root
    disabled
    oneshot

on property:dev.bootcomplete=1
    start makebootini

service usb_reset /system/bin/usb_reset.sh
    class core
    user root
    group root
    disabled
    oneshot

on property:dev.bootcomplete=1
    start usb_reset

service backlight /system/bin/vu8_backlight.sh
    class core
    user root
    group root
    disabled
    oneshot
