Commit Graph

142 Commits

Author SHA1 Message Date
Wang Han
3fb37dac40 sdm845-common: ueventd: Don't modify permissions of /dev/hw_random
This addresses an underlying problem since /dev/hw_random is used. The
issue is that EntropyMixer, which runs in system_server, needs to read
from /dev/hw_random, but thanks to our qualcomm ueventd, EntropyMixer
can never accress this node, resulting in warnings like this:

W EntropyMixer: Failed to add HW RNG output to entropy pool
W EntropyMixer: java.io.FileNotFoundException: /dev/hw_random (Permission denied)

AOSP ueventd handles this well, so just remove this line to get things
back to stage. This issue was never exposed because Google derps the
logging here, which is already fixed on Pie.

c78a463e87

Change-Id: I42c9aaa8f57306536e51c0a17febad57a5a77581
2021-02-04 14:32:47 +00:00
Ethan Chen
507c2cc14d sdm845-common: Remove bogus tombstone directory directives
* /data/tombstones and /data/vendor/tombstones are both created by
  the system's init.rc.
* Creating /tombstones at the root isn't allowed since the root is
  a ramdisk and mounted read-only.

Change-Id: I6c3a287056a2264d9e9ffe4557ecca8c6e03c0bb
2021-01-04 23:50:28 +01:00
Chenyang Zhong
d0553fba54 sdm845-common: rootdir: drop boot-time toggle on clkscale_enable
Clock scaling has been disabled in kernel to avoid workqueue
overheads.

ref: "Disable clock scaling to avoid costly workqueue overheads."
053b8a0d2a

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I31f3191ec5a0e4461048d97cb264cbfb284b9952
2021-01-03 18:26:28 +01:00
Chenyang Zhong
ac26728b47 sdm845-common: rootdir: use {up,down}_rate_limit_us
CAF replaced rate_limit_us with up_rate_limit_us and
down_rate_limit_us in msm-4.9 kernel with commit:

"ANDROID: cpufreq: schedutil: add up/down frequency transition rate limits"
ref: a37cf5fe1a

Therefore, update the node in init.qcom.power.rc as well.

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Change-Id: I26c846d7885b5308d5f8a86e7a9b43cdb6346610
2021-01-03 18:26:22 +01:00
Vijay Dandiga
3ae156236a sdm845-common: init.qcom.power.rc: Disable watermark_scale_factor
Disable WSF, because we are using EFK.

Change-Id: If6a29fbaadf6ee2190853d2bc0d4d94dd98873b8
2021-01-03 18:24:47 +01:00
Vijayavardhan Vennapusa
379089bb47 sdm845-common: init.qcom.usb.sh: Set streaming_maxburst for UVC to 10
Currently streaming_maxburst is set to 1 for UVC. Increase it
to 10 to get better throughput numbers for UVC.

Change-Id: I76458cca14953179c65119032bcba401dd8d4929
2021-01-03 17:47:26 +01:00
Vijayavardhan Vennapusa
e0478da34e sdm845-common: init.qcom.usb.sh: Add support for 1080p and 4k MJPEG format
Add required changes to add support for 1080p and 4K MJPEG format.
Also fix wHeight issue for UVC streaming, else streaming won't work
for 720p resolution.

Change-Id: Ie2b911e5940babe58156dc84df4415b34d2a7103
2021-01-03 17:46:43 +01:00
Jack Pham
1492441483 sdm845-common: init.qcom.usb.rc: Add support for PIDs 90E8 and 90E9
Add the following compositions:

0x90E8 - RNDIS + DIAG + QDSS MSM + DUN + DPL
0x90E9 - RNDIS + DIAG + QDSS MSM + DUN + DPL + ADB

Change-Id: I22e5109364e0f742499cbd33d85e4ad13065eae1
2021-01-03 15:13:22 +00:00
Sriharsha Allenki
41cdc794be sdm845-common: init.qcom.usb.rc: Fix fallback to default composition from RNDIS
If the sys.usb.state is set to any other value other than
rndis(rndis,adb) when tethering is enabled through UI, the
USB device manager falls back to the default or previous
composition.
If a RNDIS is enabled with along with other debug functions
using the persist.vendor.usb.config.extra, set the
sys.usb.state to rndis(rndis,adb) irrespective of the config
that is being enabled to prevent the fallback.

Change-Id: Ib4e120895e62fc14ac11941b6b46cc7f0460ede8
2021-01-03 15:13:22 +00:00
Ajay Agarwal
c11209ff41 sdm845-common: init.qcom.usb.rc: Add support for USB PID 0x9020
0x9020 composition includes DIAG + ADB + DUN + NMEA. Add support
for the same.

Change-Id: I83f265387e814bc96c25e0619f1b03103d818c20
2021-01-03 15:13:22 +00:00
Jack Pham
d3edfa00f0 sdm845-common: init.qcom.usb: Fix dac_override SELinux denials in charger mode
The following SELinux denials are seen when booting into charger mode:

type=1400 audit(1746.159:22): avc: denied { dac_read_search } for
 comm="init.qcom.usb.s" capability=2 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.159:23): avc: denied { dac_override } for
 comm="init.qcom.usb.s" capability=1 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.267:24): avc: denied { dac_read_search } for
 comm="init.qcom.usb.s" capability=2 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0
type=1400 audit(1746.267:25): avc: denied { dac_override } for
 comm="init.qcom.usb.s" capability=1 scontext=u:r:vendor_qti_init_shell:s0
 tcontext=u:r:vendor_qti_init_shell:s0 tclass=capability permissive=0

The DAC errors indicate that there is some kind of access, usually
by root, to a file or directory where the ownership is given to another
user/group which is not root. So since root may not have explicit
permission to access it has to override the default access control
which is flagged by SELinux.

In charger mode, like in normal boot, the init.qcom.usb.sh script
executes in the same process as init, so it is executing as root.
The script is trying to read/write to the ConfigFS string entries.
The fix for these denials is to ensure that any files/directories
being accessed by the script give root permission to access the same.
Hence remove the shell/shell ownership change when creating the USB
gadget and config subdirectories in ConfigFS.

While at it also remove mounting of ADB FFS and the ConfigFS function
instance as we are not enabling ADB in charger mode.

Change-Id: I33d6a9ce8e1bb4594a053156d46688ab11c5491d
2021-01-03 15:13:22 +00:00
Jack Pham
a7b0f740fb sdm845-common: init.qcom.usb.rc: Set MaxPower to 900mA
On some targets (such as GKI) the default bMaxPower is not able to be
hard-coded using the kernel config USB_GADGET_VBUS_DRAW. Instead we can
set this value via USB ConfigFS.

Change-Id: I467dab4fa85e7d07837f6afb6d58c73812619022
2021-01-03 15:13:22 +00:00
Jack Pham
3ba489d95a sdm845-common: init.qcom.usb.rc: New compositions for PIDs 9110 and 9111
Add the following compositions:

0x9110 - DIAG + DIAG CNSS + DUN + RMNET + ADPL + QDSS MSM (Trace) + ADB
0x9111 - DIAG + DIAG CNSS + DUN + RMNET + ADPL + QDSS MSM (Trace)

Change-Id: Id67f4bf67a40813d763f9f2a3374816f93b84a15
2021-01-03 15:13:22 +00:00
Mayank Rana
cfad99b599 sdm845-common: init.qcom.usb.rc: Update usage of USB MTP/PTP with USB F_FS driver
This change adds rules to move usage of USB MTP/PTP functionality
with USB F_FS driver instead of F_MTP/F_PTP drivers. It selects
functionfs based MTP/PTP functionality based on vendor.usb.use_ffs_mtp
property value. Set vendor.usb.use_ffs_mtp to true for Lahaina platform.

sys.usb.mtp.device_type is used by MTP server to provide perceived
device type information to host. Use correct sys.usb.mtp.device_type
property and set value 3 ( 2 - media player and 3 - Mobile handset).

Change-Id: I005bfea4babef012e331dcc4999e5e6af6465b6e
2021-01-03 15:13:22 +00:00
Jack Pham
8caa6b6fc2 sdm845-common: init.qcom.usb.rc: Consolidate init.msm.usb.configfs.rc
Remove obsolete android_usb based property triggers now
that configfs is always used. Merge in init.msm.configfs.rc
so we now have just a single .rc init file.

Also remove all other references to /sys/class/android_usb/*.

Change-Id: I06eba8e715ccee5974dc9de8ac19df6c79ae0c45
2021-01-03 15:13:01 +00:00
Jack Pham
6720cf4628 sdm845-common: init.qcom.usb.rc: Directly exec init.qcom.usb.sh helper
Directly execute the init.qcom.usb.sh helper in the 'on boot'
and 'on charger' actions rather than spawning it as a oneshot
service. After that, directly update sys.usb.config with the
from persist.vendor.usb.config. This streamlines and guarantees
it will execute synchronously which can help avoid rare race
conditions with other USB property triggers that could execute
in parallel.

Change-Id: Iaf798b146d071b11857a4cf54fbaf7ae0d5d2431
2021-01-03 15:13:01 +00:00
Jack Pham
0d208d22dd sdm845-common: init.qcom.usb: Add FFS diag instances for mdm, mdm2
Create configFS entries for two additional diag instances
and mount their respective FunctionFS paths. The diag-router
app will read/write to these for MDM and WLAN instances,
respectively.

Change-Id: Icc896f19a76e7d154e5b9b9a2f1bfc422a3e47e3
2021-01-03 15:13:01 +00:00
Jack Pham
3c1e716b6d smd845-common: init.qcom.usb: Update diag dload with PID and serial
With support now for diag-router using USB FFS driver, the kernel
driver is no longer going to automatically update the DLOAD IMEM
with the required PID/Serial information that is used when the device
transitions into crash download mode so that a port re-enumeration
is avoided. In order to pass the same PID/Serial information, the
same kernel driver now exposes configfs attributes that userspace
can write. Hence the serial number can be written once during "on
boot", and likewise the PID can be updated whenever a composition
is selected that contains Diag as the first interface.

Change-Id: I45d52ecd30fcc4978c9bb4fbe9caa75e12c0b860
2021-01-03 15:13:01 +00:00
Jack Pham
19012fb731 sdm845-common: init.qcom.usb.rc: Support Diag over FFS
Support Diag over USB using F_FS driver by instantiating "ffs.diag"
ConfigFS instance and mounting the functionfs path for the same.
Introduce a new property 'vendor.usb.diag.func.name' which is used
to distinguish between FFS and legacy f_diag and update all Diag-
enabled compositions accordingly.

The `vendor.usb.diag.func.name` property can be overridden on
a per-target basis simply by adding the key=value to the
PRODUCT_PROPERTY_OVERRIDES build variable. This gets generated
into the /vendor/build.prop which overrides the default value of
'diag' set in /vendor/default.prop.

Change-Id: I005a441b39697b489bcd8d74b5cb26fb3b47fdf7
2021-01-03 15:12:55 +00:00
Hemant Kumar
93884ea0af sdm845-common: init.msm.usb.configfs.rc: Add USB PID 0x9044 and 0x9045
0x9044 - MSM DIAG + MDM DIAG + ADB + SmartCard CCID
0x9045 - MSM DIAG + MDM DIAG + SmartCard CCID

Change-Id: I2722ae2ea44f5e75d56af7abd64dbb52817eae16
2021-01-03 14:20:35 +00:00
Hemant Kumar
9920f336b9 sdm845-common: init.msm.usb.configfs.rc: Add new USB product ids
0x90F6 - DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL+ RMNET
0x90F7 - DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL + RMNET + ADB
0x90F8 - RNDIS + DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL
0x90F9 - RNDIS + DIAG MSM + DIAG_MDM + DIAG MDM2 + QDSS MSM + QDSS_MDM
+ DUN + DPL + ADB

Change-Id: I4c5c6d0377194423443b7da240b720f51651472c
2021-01-03 14:20:35 +00:00
Hemant Kumar
c8969c434a sdm845-common: init.msm.usb.configfs: Add USB PID 0x90D9
0x90D9 includes MSM DIAG, MDM DIAG and ADB.

Change-Id: I880e3fa3b27d5c4ef028be41e11cc0fddcc41f20
2021-01-03 14:20:35 +00:00
Sean Tranchetti
9d5735ecbd sdm845-common: init.qcom.rc: remove unused propery
Removes the unused large_tcp_window_size property.

Change-Id: If7dcede6089b71a3fc18572cf7e5f7571448787d
2021-01-03 14:20:35 +00:00
Sauvik Saha
575ea11d77 sdm845-common: FR 53051: Self Contained Modules
Desc: Remove IMS daemons

Change-Id: Ifdfd61c8a2035676f39e3822f2c6522f9e040ee6
2020-11-13 22:36:04 +01:00
Bruno Martins
64ef867b66 sdm845-common: Remove legacy persist path entries from init script
Change-Id: Ifcb1ef1fc3967c7bf635537a5e05109235905c1e
2020-11-13 22:36:04 +01:00
YumeMichi
56b92abca3 sdm845-common: Fix power service name
Change-Id: I253404d56be99b08105679104b2462c06f1c0eb4
Signed-off-by: YumeMichi <do4suki@gmail.com>
2020-11-13 22:25:32 +01:00
Bruno Martins
d222b56150 sdm845-common: Remove vendor-ril lib path property trigger
No longer used with QC RIL services.

Change-Id: Ib660b20f2a3cca222a10a1919f0f81ee174bf6dc
2020-11-09 13:14:53 +02:00
Bruno Martins
8af17a83d4 sdm845-common: power: Adapt extension to new aidl power HAL
Change-Id: I58ac49957d8d28ad904912986d89ac8db4820ff9
2020-10-17 21:18:53 +01:00
Karthik Gopalan
3b0eb370f3 sdm845-common: Set lmkd.reinit property from vendor init
Set lmkd.reinit property to 1. This will trigger
reinit of lmkd service.

CRs-Fixed: 2692843

Change-Id: Ib946b01ca1dc013f0148ca702e4d550cde32b6c2
2020-10-17 22:13:33 +02:00
Ramakant Singh
33af46f1ef sdm845-common: init: Add vendor prefix for shell
qti_init_shell renamed to
vendor_qti_init_shell

Change-Id: I4cfe1d8e15892a4948ece52aa799b2a60826d5f9
2020-10-17 22:06:21 +02:00
Dhananjay Kumar
dcc51667d0 sdm845-common: init: update audio hal service override as per latest base service definition
Change-Id: I1c57ad2e448a95230a4adfff8fba94ffb0cddead
2020-10-09 16:17:34 +01:00
Jimmy Chen
546ad1520b sdm845-common: Move supplicant service init to wpa_supplicant
Bug: 138790309
Test: boot and wifi function is ok
Change-Id: I35cf3e03566443e20799623045eacd423fd7f5c4
2020-10-09 16:17:34 +01:00
Divya Sharma
dfa4ef93c7 sdm845-common: load_system_props is deprecated and causes a build error.
Change-Id: I71df37c605ed805dc1f8bc2e626a33cf6818e9f7
2020-10-09 16:17:34 +01:00
Bruno Martins
d628f0b4c6 sdm845-common: Switch to common QTI power HAL
There's nothing really that different here when compared to the
common HAL except for the specific DT2W handling, which can simply
be supported as a power feature lib.

Change-Id: I4c9c2530c8090e05dab38ed829d59ece5e00e1fb
2020-07-17 01:09:19 +02:00
Bruno Martins
70547f7ea6 sdm845-common: sepolicy: Address thermal-engine denials
Change-Id: I25abb62dc8c46cfc6ce8c85aa532e9e94bdf9622
2020-05-14 23:51:41 +01:00
Bruno Martins
998ed9e6bb sdm845-common: Drop Android LMK parameters configuration
Android LMK was disabled in the kernel in favor of Low Memory Killer Daemon (lmkd).

Change-Id: Ibd97ea48bf6cc635277a7e23fb460ee7f1737121
2020-05-10 15:14:47 +01:00
LuK1337
0a5161eaee sdm845-common: Drop SSR blobs and set SSR restart_level in init.qcom.rc
Change-Id: I32fc08c9ad36b9c8ebfc019fc87a19eece18f0b4
2020-05-10 00:52:48 +02:00
Madhanraj Chelladurai
885794a953 sdm845-common: Add locSll library and add permissions to device node
Change-Id: Idacac778610699af0f01d65096092328bbe8ac1d
CRs-Fixed: 2413585
2020-04-19 22:57:01 +02:00
Xiaojun Sang
066ff3dd91 sdm845-common: add aud_pasthru_adsp access for audio
Change-Id: If4cb96e00ccfaff60b08c42d92370cb46fbb9a0e
2020-04-19 22:57:01 +02:00
Pratham Pratap
c521dc4440 sdm845-common: Prevent enumeration in ADB only composition
During bootup the device first enumerates in ADB only composition
and then falls back to the persist.sys.usb.config.
Prevent this enumeration in ADB only composition during bootup
by setting the sys.usb.configfs from init.qcom.usb.rc

Change-Id: I6c93a778cc0decc6b5c256c60734b0597d753a9d
2020-04-05 14:27:28 +02:00
Ajay Agarwal
85c2452537 sdm845-common: init.msm.usb.configfs.rc: Add support for USB PID 0x9020
0x9020 composition includes DIAG + ADB + DUN + NMEA. Add support
for the same.

Change-Id: I364d4e87b63d7e5dfb394db6e92e650764b7cc96
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2020-04-05 14:27:23 +02:00
Hemant Kumar
773b278760 sdm845-common: init.qcom.usb: Add vendor.usb.configfs property
Set sys.usb.configfs property when vendor.usb.configfs is set.
This prevents two enumerations at boot up. First one is done
when system core init enumerates with adb only composition. Soon
after this vendor default usb composition switch happens. Sometimes
controller fails to halt in the middle of control transfers when run
stop bit is cleared to perform composition switch to initiate second
enumeration. This is resulting in to device enumeration SET ADDRESS
failure as controller stops accepting SETUP packet from Host.

Change-Id: I5a4840d8eedf59809cc4d158f95d35f0477830bb
2020-04-05 14:27:16 +02:00
Pratham Pratap
0ed33caaa2 sdm845-common: init: USB: Modify rules to support QDSS using SW or BAM path
On some targets, QDSS can be used over SW path. This change
adds an property for QDSS instance name which will be defined
for each target in target.rc file. That property can be changed
accordingly for targets which uses QDSS over BAM or SW.

Change-Id: Ibf9af45f20feb7434d15b02ff86c91fce914dbd2
2020-04-05 14:27:09 +02:00
Li Li
b273d44783 sdm845-common: ueventd.qcom.rc: set permissions for /dev/sp_nvm device
/dev_sp_nvm is used by sp_iar_lib to store CMAC values for spu
 firmware and application

Change-Id: I2ac5f29b66448a526cdbc6a1ccefd5f80066c170
Signed-off-by: Li Li <liil1@codeaurora.org>
2020-04-04 15:40:30 +01:00
Amandeep Virk
aba63c164c sdm845-common: qcom: devices: Add iuicc device for Secure Processor
Add iuicc device that can be opened by spdaemon to create
iuicc channel and interact with iuicc application on the
Secure Processor

Change-Id: I2c37053a9e7445abfe4f0c11868277bbf133266a
2020-04-04 15:39:45 +01:00
Liron Daniel
abdb4df115 sdm845-common: ueventd.qcom.rc: Add permission to /dev/spu_hal_ssr
Needed for spu HAL service to register on spcom channel for ssr
notifications

Change-Id: I43f070bf9948d4330f9ae05f9d631f2681f75164
2020-04-04 15:39:00 +01:00
Timothy Sham
f3db3a6342 sdm845-common: add permission for i2c7 device
Add audio domain permission for i2c7 device node.

Change-Id: I5d99360985f0b58fa355e22b0e1dd9c3e7c08318
2020-04-04 15:35:32 +01:00
Sidipotu Ashok
bdf3d31e05 sdm845-common: Define SYS_NICE caps for android.hardware.audio@2.0-service.
- Grant SYS_NICE capabilities to audio HAL processes as sound trigger
HAL threads need to run at real time priority as well as use the
CPU affinity, for far field voice.

CRs-Fixed: 2359951
Change-Id: Ie0da744978609c750e92aec2c6001ace1868ad31
2020-04-04 15:30:14 +01:00
Bruno Martins
d9a18ba693 sdm845-common: power: Remove CPU freq boost on power key input
Support has been removed from the kernel.

Change-Id: I4db18c2766e81562b1902212bd95b0f86e5db205
2020-02-09 15:35:53 +00:00
Subash Abhinov Kasiviswanathan
66e026c2c1 sdm845-common: init.qcom.rc: FR 53051: remove configs for vendor data modules
As part of this FR we are moving vendor data specific module
configurations to custom vendor data init rc files

Change-Id: I64e839c2b0fbd0826fe79b95259af2a10e8b1ea1
2020-02-02 10:09:14 +00:00