summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Wang <leozwang@google.com>2015-12-17 18:49:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-12-17 18:49:55 +0000
commit5951be7c6ea2a703cb56ade49067560f5d95a923 (patch)
treed5624a48c2129aab6b65d2fcde59d3a992752138
parent35ff0e77b16f8d92173771734f0100d4e89e3207 (diff)
parente2270f99ceadf25087eef77b9836bede5b677057 (diff)
downloadfreescale-5951be7c6ea2a703cb56ade49067560f5d95a923.tar.gz
Merge "Add i.MX6UL suport for brillo" into mnc-brillo-dev
-rwxr-xr-xsoc/imx6ul/init.freescale.rc30
-rw-r--r--soc/imx6ul/init.freescale.usb.rc77
-rwxr-xr-xsoc/imx6ul/sepolicy/file_contexts9
-rwxr-xr-xsoc/imx6ul/sepolicy/init.te1
-rw-r--r--soc/imx6ul/sepolicy/mediaserver.te1
-rwxr-xr-xsoc/imx6ul/sepolicy/metagen.te4
-rwxr-xr-xsoc/imx6ul/sepolicy/sensors.te27
-rwxr-xr-xsoc/imx6ul/sepolicy/sensorservice.te5
-rwxr-xr-xsoc/imx6ul/sepolicy/slotmeta.te1
-rwxr-xr-xsoc/imx6ul/sepolicy/update_engine.te2
-rw-r--r--soc/imx6ul/sepolicy/wifi_setup.te1
-rwxr-xr-xsoc/imx6ul/soc.mk60
-rwxr-xr-xsoc/imx6ul/ueventd.freescale.rc87
13 files changed, 305 insertions, 0 deletions
diff --git a/soc/imx6ul/init.freescale.rc b/soc/imx6ul/init.freescale.rc
new file mode 100755
index 0000000..926b0ca
--- /dev/null
+++ b/soc/imx6ul/init.freescale.rc
@@ -0,0 +1,30 @@
+#
+# Copyright 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import init.freescale.usb.rc
+
+on init
+ symlink /dev/block/mmcblk1p5 /dev/block/system_a
+ symlink /dev/block/mmcblk1p8 /dev/block/system_b
+
+on fs
+ mount_all /fstab.device
+ setprop ro.board.platform imx6ul
+
+on post-fs
+ restorecon /slotmeta
+ restorecon /slotmeta/slotmeta.data
+ restorecon /slotmeta/.slotmeta.data.bak
diff --git a/soc/imx6ul/init.freescale.usb.rc b/soc/imx6ul/init.freescale.usb.rc
new file mode 100644
index 0000000..c0021f3
--- /dev/null
+++ b/soc/imx6ul/init.freescale.usb.rc
@@ -0,0 +1,77 @@
+# Copyright 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+on init
+ write /sys/class/android_usb/android0/f_rndis/manufacturer Freescale
+ write /sys/class/android_usb/android0/f_rndis/vendorID 18D1
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+
+on boot
+ write /sys/class/android_usb/android0/iSerial $ro.serialno
+ write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
+ write /sys/class/android_usb/android0/iProduct $ro.product.model
+
+on fs
+ mkdir /dev/usb-ffs 0770 shell shell
+ mkdir /dev/usb-ffs/adb 0770 shell shell
+ mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
+
+# USB RNDIS configuration.
+on property:sys.usb.config=rndis
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e23
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/bDeviceClass 224
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e41
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e42
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ptp
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e43
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ptp,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18d1
+ write /sys/class/android_usb/android0/idProduct 4e44
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
diff --git a/soc/imx6ul/sepolicy/file_contexts b/soc/imx6ul/sepolicy/file_contexts
new file mode 100755
index 0000000..02ef075
--- /dev/null
+++ b/soc/imx6ul/sepolicy/file_contexts
@@ -0,0 +1,9 @@
+/dev/ttymxc[0-9]* u:object_r:tty_device:s0
+/system/bin/fsl_sensor_fusion u:object_r:sensors_exec:s0
+/system/bin/metagen u:object_r:metagen_exec:s0
+/dev/FreescaleAccelerometer u:object_r:sensors_device:s0
+/dev/FreescaleMagnetometer u:object_r:sensors_device:s0
+/dev/FreescaleGyroscope u:object_r:sensors_device:s0
+/slotmeta u:object_r:slotmeta:s0
+/slotmeta/slotmeta.data u:object_r:slotmeta:s0
+/slotmeta/.slotmeta.data.bak u:object_r:slotmeta:s0
diff --git a/soc/imx6ul/sepolicy/init.te b/soc/imx6ul/sepolicy/init.te
new file mode 100755
index 0000000..cccd7f3
--- /dev/null
+++ b/soc/imx6ul/sepolicy/init.te
@@ -0,0 +1 @@
+allow init functionfs:dir mounton;
diff --git a/soc/imx6ul/sepolicy/mediaserver.te b/soc/imx6ul/sepolicy/mediaserver.te
new file mode 100644
index 0000000..72acfbb
--- /dev/null
+++ b/soc/imx6ul/sepolicy/mediaserver.te
@@ -0,0 +1 @@
+allow mediaserver debug_prop:property_service set;
diff --git a/soc/imx6ul/sepolicy/metagen.te b/soc/imx6ul/sepolicy/metagen.te
new file mode 100755
index 0000000..cc50ac7
--- /dev/null
+++ b/soc/imx6ul/sepolicy/metagen.te
@@ -0,0 +1,4 @@
+type metagen, domain;
+type metagen_exec, exec_type, file_type;
+allow metagen slotmeta:dir { getattr search relabelfrom rw_dir_perms rmdir };
+allow metagen slotmeta:file rw_file_perms;
diff --git a/soc/imx6ul/sepolicy/sensors.te b/soc/imx6ul/sepolicy/sensors.te
new file mode 100755
index 0000000..81fdf8a
--- /dev/null
+++ b/soc/imx6ul/sepolicy/sensors.te
@@ -0,0 +1,27 @@
+# Integrated NXP sensor process.
+type sensors, domain;
+type sensors_exec, exec_type, file_type;
+
+# Started by init.
+init_daemon_domain(sensors)
+
+# Change own perms to (nobody,nobody).
+allow sensors self:capability { setuid setgid };
+# Chown /data/misc/sensors/debug/ to nobody.
+allow sensors self:capability chown;
+dontaudit sensors self:capability fsetid;
+
+# Access /data/misc/sensors/debug and /data/system/sensors/settings.
+allow sensors self:capability dac_read_search;
+dontaudit sensors self:capability dac_override;
+
+# Access sensor nodes (/dev/msm_dsps).
+allow sensors sensors_device:chr_file rw_file_perms;
+
+# Wake lock access.
+wakelock_use(sensors)
+
+allow sensors cgroup:dir { create add_name };
+allow sensors input_device:chr_file rw_file_perms;
+allow sensors input_device:dir r_dir_perms;
+allow sensors uhid_device:chr_file rw_file_perms;
diff --git a/soc/imx6ul/sepolicy/sensorservice.te b/soc/imx6ul/sepolicy/sensorservice.te
new file mode 100755
index 0000000..0dc30c5
--- /dev/null
+++ b/soc/imx6ul/sepolicy/sensorservice.te
@@ -0,0 +1,5 @@
+allow sensorservice sysfs:file write;
+allow sensorservice input_device:dir r_file_perms;
+allow sensorservice input_device:chr_file r_file_perms;
+allow sensorservice self:capability net_admin;
+allow sensorservice sysfs:dir r_file_perms;
diff --git a/soc/imx6ul/sepolicy/slotmeta.te b/soc/imx6ul/sepolicy/slotmeta.te
new file mode 100755
index 0000000..1ee9c13
--- /dev/null
+++ b/soc/imx6ul/sepolicy/slotmeta.te
@@ -0,0 +1 @@
+type slotmeta, file_type;
diff --git a/soc/imx6ul/sepolicy/update_engine.te b/soc/imx6ul/sepolicy/update_engine.te
new file mode 100755
index 0000000..6567e76
--- /dev/null
+++ b/soc/imx6ul/sepolicy/update_engine.te
@@ -0,0 +1,2 @@
+allow update_engine slotmeta:dir { getattr search relabelfrom rw_dir_perms rmdir };
+allow update_engine slotmeta:file rw_file_perms;
diff --git a/soc/imx6ul/sepolicy/wifi_setup.te b/soc/imx6ul/sepolicy/wifi_setup.te
new file mode 100644
index 0000000..a3d5c63
--- /dev/null
+++ b/soc/imx6ul/sepolicy/wifi_setup.te
@@ -0,0 +1 @@
+allow wifi_setup proc:file open;
diff --git a/soc/imx6ul/soc.mk b/soc/imx6ul/soc.mk
new file mode 100755
index 0000000..a99b258
--- /dev/null
+++ b/soc/imx6ul/soc.mk
@@ -0,0 +1,60 @@
+# Copyright 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# TODO(leecam): Make this automatic.
+LOCAL_PATH := hardware/bsp/freescale/soc/imx6ul
+
+# Arm32 device.
+TARGET_ARCH := arm
+TARGET_ARCH_VARIANT := armv7-a
+TARGET_CPU_VARIANT := generic
+TARGET_CPU_ABI := armeabi-v7a
+TARGET_CPU_ABI2 := armeabi
+TARGET_KERNEL_ARCH := $(TARGET_ARCH)
+
+TARGET_NO_BOOTLOADER := false
+TARGET_NO_KERNEL := false
+
+TARGET_KERNEL_DTB := imx6ul-14x14-evk.dtb
+BOARD_KERNEL_BASE := 0x82800000
+
+BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 131072
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/init.freescale.rc:root/init.freescale.rc \
+ $(LOCAL_PATH)/init.freescale.usb.rc:root/init.freescale.usb.rc \
+ $(LOCAL_PATH)/ueventd.freescale.rc:root/ueventd.freescale.rc \
+ system/core/rootdir/init.usb.rc:root/init.usb.rc \
+ system/core/rootdir/ueventd.rc:root/ueventd.rc \
+ $(LOCAL_PATH)/../../peripheral/bootctl/tool/misc.img:misc.img \
+
+BOARD_SEPOLICY_DIRS += $(LOCAL_PATH)/sepolicy
+
+# Set up the local kernel.
+TARGET_KERNEL_SRC := hardware/bsp/kernel/freescale/kernel_imx
+TARGET_KERNEL_DEFCONFIG := imx_v7_android_defconfig
+TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(ANDROID_BUILD_TOP)/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-
+
+# Lights HAL package.
+DEVICE_PACKAGES += \
+ lights.$(soc_name)
+
+# WiFi HAL package.
+DEVICE_PACKAGES += \
+ wifi_driver.$(soc_name)
diff --git a/soc/imx6ul/ueventd.freescale.rc b/soc/imx6ul/ueventd.freescale.rc
new file mode 100755
index 0000000..967e40a
--- /dev/null
+++ b/soc/imx6ul/ueventd.freescale.rc
@@ -0,0 +1,87 @@
+#
+# Copyright 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+/dev/pmem_gpu 0660 system graphics
+/dev/ttymxc5 0660 bluetooth bluetooth
+/dev/snd/* 0660 system audio
+/dev/ttyUSB* 0640 radio radio
+/dev/ttyACM* 0640 radio radio
+/dev/video* 0660 system camera
+/dev/video0 0660 system camera
+/dev/video1 0660 system camera
+/dev/video2 0660 system camera
+/dev/video16 0660 system graphics
+/dev/mxc_ipu 0660 media system
+/dev/mxc_vpu 0660 media system
+/dev/uinput 0660 system bluetooth
+/dev/ttymxc2 0660 system gps
+/dev/ttya0 0660 system gps
+/dev/ptya0 0660 system gps
+/dev/ttya1 0660 system gps
+/dev/ptya1 0660 system gps
+/dev/ion 0666 media system
+/dev/galcore 0666 system graphics
+/dev/graphics/fb0 0660 system graphics
+/dev/watchdog 0660 system root
+/dev/ir 0660 system system
+/dev/mma8x5x 0640 compass system
+/dev/caam_kb 0660 system system
+
+#sensors sysfs
+/sys/class/misc/Freescale* name 0660 root input
+/sys/class/misc/Freescale* max 0660 root input
+/sys/class/misc/Freescale* min 0660 root input
+/sys/class/misc/Freescale* poll 0660 root input
+/sys/class/misc/Freescale* enable 0660 root input
+/sys/class/misc/Freescale* position 0660 root input
+/sys/class/misc/Freescale* poll_delay 0660 root input
+/sys/class/misc/Freescale* fifo 0660 root input
+/dev/FreescaleAccelerometer 0660 system input
+/dev/FreescaleMagnetometer 0660 system input
+/dev/FreescaleGyroscope 0660 system input
+
+
+# sysfs properties
+/sys/devices/virtual/input/input* name 0660 root input
+/sys/devices/virtual/input/input* max 0660 root input
+/sys/devices/virtual/input/input* min 0660 root input
+/sys/devices/virtual/input/input* poll 0660 root input
+/sys/devices/virtual/input/input* enable 0660 root input
+/sys/devices/virtual/input/input* position 0660 root input
+/sys/devices/virtual/input/input* poll_delay 0660 root input
+/sys/devices/virtual/input/input* fifo 0660 root input
+/sys/devices/virtual/thermal/thermal_zone* trip_point_0_temp 0660 system system
+/sys/devices/virtual/thermal/thermal_zone* trip_point_1_temp 0660 system system
+/sys/devices/virtual/thermal/thermal_zone* trip_point_2_temp 0660 system system
+
+/sys/devices/platform/mxsdhci.2/mmc_host/mmc0/mmc0:000* boot_bus_config 0660 root root
+/sys/devices/platform/mxsdhci.2/mmc_host/mmc0/mmc0:000* boot_config 0660 root root
+# for sabresd
+/sys/devices/soc0/soc.0/2100000.aips-bus/21a8000.i2c/i2c-2/2-0044 mode 0660 system system
+/sys/devices/soc0/soc.0/2100000.aips-bus/21a8000.i2c/i2c-2/2-0044 lux 0660 system system
+/sys/devices/soc0/soc.0/2100000.aips-bus/21a8000.i2c/i2c-2/2-0044 int_lt_lux 0660 system system
+/sys/devices/soc0/soc.0/2100000.aips-bus/21a8000.i2c/i2c-2/2-0044 int_ht_lux 0660 system system
+# for sabreauto
+/sys/devices/soc0/soc.1/2100000.aips-bus/21a8000.i2c/i2c-1/1-0044 mode 0660 system system
+/sys/devices/soc0/soc.1/2100000.aips-bus/21a8000.i2c/i2c-1/1-0044 lux 0660 system system
+/sys/devices/soc0/soc.1/2100000.aips-bus/21a8000.i2c/i2c-1/1-0044 int_lt_lux 0660 system system
+/sys/devices/soc0/soc.1/2100000.aips-bus/21a8000.i2c/i2c-1/1-0044 int_ht_lux 0660 system system
+/sys/devices/platform/mxc_sdc_fb.0/graphics/fb* fsl_disp_property 0660 system graphics
+/sys/devices/platform/mxc_sdc_fb.1/graphics/fb* fsl_disp_property 0660 system graphics
+/sys/devices/platform/mxc_sdc_fb.0/graphics/fb* mode 0660 system graphics
+/sys/devices/platform/mxc_sdc_fb.1/graphics/fb* mode 0660 system graphics
+/sys/devices/platform/mxc_dvfs_core.0 enable 0660 system system
+/sys/devices/platform/busfreq.0 enable 0660 system system