summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Elshuber <martin.elshuber@theobroma-systems.com>2017-11-13 12:08:13 +0100
committerMartin Elshuber <martin.elshuber@theobroma-systems.com>2017-11-13 12:08:54 +0100
commit3556a95fd23d1e0205025dbe80867f87d414a3db (patch)
tree22ba8bc46653b3437b9979d4997049e7c240f08a
parent119af01f51cfbc9e5219514ff01875894c106389 (diff)
Added puma_rk3399 definitions
-rwxr-xr-xaudio_policy_puma_rk3399.conf109
-rwxr-xr-xdevice.mk7
-rw-r--r--fstab.puma_rk3399.bootmode.emmc9
-rw-r--r--fstab.puma_rk3399.bootmode.sd9
-rw-r--r--fstab.puma_rk3399.bootmode.unknown9
-rwxr-xr-xinit.puma_rk3399.rc19
-rw-r--r--init.puma_rk3399.usb.rc162
7 files changed, 324 insertions, 0 deletions
diff --git a/audio_policy_puma_rk3399.conf b/audio_policy_puma_rk3399.conf
new file mode 100755
index 0000000..84315ad
--- /dev/null
+++ b/audio_policy_puma_rk3399.conf
@@ -0,0 +1,109 @@
+# Global configuration section: lists input and output devices always present on the device
+# as well as the output device selected by default.
+# Devices are designated by a string that corresponds to the enum in audio.h
+
+global_configuration {
+ attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
+ default_output_device AUDIO_DEVICE_OUT_SPEAKER
+ attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX
+}
+
+# audio hardware module section: contains descriptors for all audio hw modules present on the
+# device. Each hw module node is named after the corresponding hw module library base name.
+# For instance, "primary" corresponds to audio.primary.<device>.so.
+# The "primary" module is mandatory and must include at least one output with
+# AUDIO_OUTPUT_FLAG_PRIMARY flag.
+# Each module descriptor contains one or more output profile descriptors and zero or more
+# input profile descriptors. Each profile lists all the parameters supported by a given output
+# or input stream category.
+# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
+# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
+
+audio_hw_modules {
+ primary {
+ outputs {
+ primary {
+ sampling_rates 44100|48000
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_SPDIF
+ flags AUDIO_OUTPUT_FLAG_PRIMARY
+ }
+ spdif_passthrough {
+ sampling_rates 44100|48000
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_SPDIF
+ flags AUDIO_OUTPUT_FLAG_DIRECT
+ }
+
+ hdmi {
+ sampling_rates 44100|48000|192000
+ channel_masks AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_7POINT1
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_AUX_DIGITAL
+ flags AUDIO_OUTPUT_FLAG_DIRECT
+ }
+ }
+ inputs {
+ primary {
+ sampling_rates 8000|11025|16000|22050|32000|44100|48000
+ channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET
+ }
+ }
+ }
+ a2dp {
+ outputs {
+ a2dp {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_ALL_A2DP
+ }
+ }
+ }
+ usb {
+ outputs {
+ usb_accessory {
+ sampling_rates 44100
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_USB_ACCESSORY
+ }
+ usb_device {
+ sampling_rates dynamic
+ channel_masks dynamic
+ formats dynamic
+ devices AUDIO_DEVICE_OUT_USB_DEVICE
+ }
+ }
+ inputs {
+ usb_device {
+ sampling_rates dynamic
+ channel_masks AUDIO_CHANNEL_IN_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_IN_USB_DEVICE
+ }
+ }
+ }
+ r_submix {
+ outputs {
+ submix {
+ sampling_rates 48000
+ channel_masks AUDIO_CHANNEL_OUT_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
+ }
+ }
+ inputs {
+ submix {
+ sampling_rates 48000
+ channel_masks AUDIO_CHANNEL_IN_STEREO
+ formats AUDIO_FORMAT_PCM_16_BIT
+ devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
+ }
+ }
+ }
+}
diff --git a/device.mk b/device.mk
index 3720bbb..b99c90c 100755
--- a/device.mk
+++ b/device.mk
@@ -148,9 +148,16 @@ PRODUCT_COPY_FILES += \
endif
+ifeq ($(strip $(TARGET_BOARD_HARDWARE)),puma_rk3399)
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/fstab.puma_rk3399.bootmode.unknown:root/fstab.puma_rk3399.bootmode.unknown \
+ $(LOCAL_PATH)/fstab.puma_rk3399.bootmode.emmc:root/fstab.puma_rk3399.bootmode.emmc \
+ $(LOCAL_PATH)/fstab.puma_rk3399.bootmode.sd:root/fstab.puma_rk3399.bootmode.sd
+else
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/fstab.rk30board.bootmode.unknown:root/fstab.rk30board.bootmode.unknown \
$(LOCAL_PATH)/fstab.rk30board.bootmode.emmc:root/fstab.rk30board.bootmode.emmc
+endif
# For audio-recoard
PRODUCT_PACKAGES += \
diff --git a/fstab.puma_rk3399.bootmode.emmc b/fstab.puma_rk3399.bootmode.emmc
new file mode 100644
index 0000000..895cf9a
--- /dev/null
+++ b/fstab.puma_rk3399.bootmode.emmc
@@ -0,0 +1,9 @@
+# dev /devk devtmpfs defaults defaults
+/dev/block/platform/fe330000.sdhci/by-name/system /system ext4 ro,noatime,nodiratime wait
+/dev/block/platform/fe330000.sdhci/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+/dev/block/platform/fe330000.sdhci/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+/dev/block/platform/fe330000.sdhci/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+
+# for usb3.0
+# I am not sure about this automount rule for USB3 devices
+/dev/block/platform/usb@*/*.dwc3* auto auto defaults voldmanaged=usb:auto
diff --git a/fstab.puma_rk3399.bootmode.sd b/fstab.puma_rk3399.bootmode.sd
new file mode 100644
index 0000000..36e2500
--- /dev/null
+++ b/fstab.puma_rk3399.bootmode.sd
@@ -0,0 +1,9 @@
+# dev /devk devtmpfs defaults defaults
+/dev/block/platform/fe320000.dwmmc/by-name/system /system ext4 ro,noatime,nodiratime wait
+/dev/block/platform/fe320000.dwmmc/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+/dev/block/platform/fe320000.dwmmc/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+/dev/block/platform/fe320000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+
+# for usb3.0
+# I am not sure about this automount rule for USB3 devices
+/dev/block/platform/usb@*/*.dwc3* auto auto defaults voldmanaged=usb:auto
diff --git a/fstab.puma_rk3399.bootmode.unknown b/fstab.puma_rk3399.bootmode.unknown
new file mode 100644
index 0000000..2d9521d
--- /dev/null
+++ b/fstab.puma_rk3399.bootmode.unknown
@@ -0,0 +1,9 @@
+# dev /devk devtmpfs defaults defaults
+LABEL=system /system ext4 ro,noatime,nodiratime wait
+LABEL=cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+LABEL=metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
+LABEL=userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+
+# for usb3.0
+# I am not sure about this automount rule for USB3 devices
+/dev/block/platform/usb@*/*.dwc3* auto vfat defaults voldmanaged=usb:auto
diff --git a/init.puma_rk3399.rc b/init.puma_rk3399.rc
new file mode 100755
index 0000000..925d08e
--- /dev/null
+++ b/init.puma_rk3399.rc
@@ -0,0 +1,19 @@
+import init.${ro.hardware}.bootmode.${ro.bootmode}.rc
+
+on init
+ chown root system /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/min_freq
+ chmod 0644 /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/min_freq
+ chown root system /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/max_freq
+ chmod 0644 /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/max_freq
+ chown root system /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/governor
+ chmod 0644 /sys/bus/platform/drivers/rk3399-dmc-freq/dmc/devfreq/dmc/governor
+
+ chown root system /sys/class/devfreq/ff9a0000.gpu/governor
+ chmod 0644 /sys/class/devfreq/ff9a0000.gpu/governor
+ chown root system /sys/class/devfreq/ff9a0000.gpu/min_freq
+ chmod 0644 /sys/class/devfreq/ff9a0000.gpu/min_freq
+ chown root system /sys/class/devfreq/ff9a0000.gpu/max_freq
+ chmod 0644 /sys/class/devfreq/ff9a0000.gpu/max_freq
+
+on fs
+ mount_all fstab.${ro.hardware}.bootmode.${ro.bootmode}
diff --git a/init.puma_rk3399.usb.rc b/init.puma_rk3399.usb.rc
new file mode 100644
index 0000000..99633e2
--- /dev/null
+++ b/init.puma_rk3399.usb.rc
@@ -0,0 +1,162 @@
+on init
+ # write /sys/class/android_usb/android0/iSerial ${ro.serialno}
+ # write /sys/class/android_usb/android0/f_rndis/manufacturer RockChip
+ # write /sys/class/android_usb/android0/f_rndis/vendorID 2207
+ # 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/f_rndis/manufacturer RockChip
+ write /sys/class/android_usb/android0/f_rndis/vendorID 2207
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
+ write /sys/class/android_usb/android0/iProduct ${ro.product.model}
+ write /sys/class/android_usb/android0/f_mass_storage/inquiry_string $ro.product.usbfactory
+
+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
+
+on property:sys.usb.config=adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0006
+ 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=mtp
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0001
+ 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 2207
+ write /sys/class/android_usb/android0/idProduct 0011
+ 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=rndis
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0003
+ 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=rndis,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0013
+ 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
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# USB midi configuration
+on property:sys.usb.config=midi
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0004
+ 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}
+
+# USB midi configuration, with adb
+on property:sys.usb.config=midi,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0014
+ 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
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0002
+ 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 2207
+ write /sys/class/android_usb/android0/idProduct 0012
+ 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=mass_storage
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0000
+ 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=mass_storage,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0010
+ 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=accessory
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18D1
+ write /sys/class/android_usb/android0/idProduct 2D00
+ 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=accessory,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18D1
+ write /sys/class/android_usb/android0/idProduct 2D01
+ 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=acm
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0005
+ 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=acm,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0005
+ 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=rndis,dm
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 2207
+ write /sys/class/android_usb/android0/idProduct 0003
+ 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}
+