init: adjust boost value am: f8454ce693 am: 669b065cb2

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/16389049

Change-Id: I56741fd60430d05521c3353914a27a23c7a89aa9
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index d4eed86..dc271cb 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -340,26 +340,10 @@
 # H/W align restriction of MM IPs
 BOARD_EXYNOS_S10B_FORMAT_ALIGN := 64
 
-# WiFi
-BOARD_WLAN_DEVICE := bcmdhd
-BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
-BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
-WPA_SUPPLICANT_VERSION := VER_0_8_X
-BOARD_WPA_SUPPLICANT_DRIVER := NL80211
-BOARD_HOSTAPD_DRIVER := NL80211
-# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {1 STA + 1 P2P}
-# or {1 STA + 1 NAN} or {2 STA}
-WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}
-WIFI_FEATURE_WIFI_EXT_HAL := true
-WIFI_FEATURE_IMU_DETECTION := true
-# Avoid Wifi reset on MAC Address change
-WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
-WIFI_FEATURE_HOSTAPD_11AX := true
-
 # NeuralNetworks
 GPU_SOURCE_PRESENT := $(wildcard vendor/arm/mali/valhall)
 GPU_PREBUILD_PRESENT := $(wildcard vendor/google_devices/gs101/prebuilts/gpu/libs)
-ifneq "$(or $(GPU_SOURCE_PRESENT),$(GPU_PREBUILD_PRESENT))" ""
+ifneq (,$(strip $(GPU_SOURCE_PRESENT) $(GPU_PREBUILD_PRESENT)))
 ARMNN_COMPUTE_CL_ENABLE := 1
 else
 ARMNN_COMPUTE_CL_ENABLE := 0
@@ -418,4 +402,7 @@
 # Enable larger logbuf
 BOARD_KERNEL_CMDLINE += log_buf_len=1024K
 
+# Protected VM firmware
+BOARD_PVMFWIMAGE_PARTITION_SIZE := 0x00100000
+
 -include vendor/google_devices/gs101/proprietary/BoardConfigVendor.mk
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..4d9cf6e
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,2 @@
+per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com
+per-file powerhint.json = wvw@google.com,joaodias@google.com,jenhaochen@google.com,rkganesh@google.com,jychen@google.com
diff --git a/bluetooth/bluetooth.mk b/bluetooth/bluetooth.mk
new file mode 100644
index 0000000..f203610
--- /dev/null
+++ b/bluetooth/bluetooth.mk
@@ -0,0 +1,4 @@
+PRODUCT_PACKAGES += \
+	android.hardware.bluetooth@1.1-service.bcmbtlinux
+
+BOARD_SEPOLICY_DIRS += device/google/gs101-sepolicy/bluetooth
diff --git a/conf/fstab.gs101.in b/conf/fstab.gs101.in
index a88d1cc..014c047 100644
--- a/conf/fstab.gs101.in
+++ b/conf/fstab.gs101.in
@@ -10,10 +10,6 @@
 vendor                                                   /vendor                     ext4    ro,barrier=1             wait,slotselect,avb=vbmeta_vendor,logical,first_stage_mount
 vendor_dlkm                                              /vendor_dlkm                ext4    ro,barrier=1             wait,slotselect,avb=vbmeta,logical,first_stage_mount
 /dev/block/platform/14700000.ufs/by-name/boot            /boot                       emmc    defaults                 slotselect,avb=boot,first_stage_mount
-/dev/block/platform/14700000.ufs/by-name/efs             /mnt/vendor/efs             ext4    defaults,noatime,rw      wait,check,formattable
-/dev/block/platform/14700000.ufs/by-name/efs_backup      /mnt/vendor/efs_backup      ext4    defaults,noatime,rw      wait,check,formattable
-/dev/block/platform/14700000.ufs/by-name/modem_userdata  /mnt/vendor/modem_userdata  ext4    defaults,noatime,rw      wait,check,formattable
-/dev/block/platform/14700000.ufs/by-name/modem           /mnt/vendor/modem_img       ext4    ro,defaults,context=u:object_r:modem_img_file:s0,barrier=1    wait,slotselect
 /dev/block/platform/14700000.ufs/by-name/misc            /misc                       emmc    defaults                 wait
 /dev/block/platform/14700000.ufs/by-name/metadata        /metadata                   ext4    noatime,nosuid,nodev,data=journal,commit=1    wait,check,formattable,first_stage_mount,metadata_csum
 /dev/block/platform/14700000.ufs/by-name/pvmfw           /pvmfw                      emmc    defaults                 wait,slotselect,avb=pvmfw,first_stage_mount
diff --git a/conf/fstab.modem b/conf/fstab.modem
new file mode 100644
index 0000000..44a936c
--- /dev/null
+++ b/conf/fstab.modem
@@ -0,0 +1,7 @@
+# Android fstab file.
+# <src>                  <mnt_point>         <type>    <mnt_flags and options>                               <fs_mgr_flags>
+# Keep persist in an fstab file, since we need to run fsck on it after abnormal shutdown.
+/dev/block/platform/14700000.ufs/by-name/efs             /mnt/vendor/efs             ext4    defaults,noatime,rw      wait,check,formattable
+/dev/block/platform/14700000.ufs/by-name/efs_backup      /mnt/vendor/efs_backup      ext4    defaults,noatime,rw      wait,check,formattable
+/dev/block/platform/14700000.ufs/by-name/modem_userdata  /mnt/vendor/modem_userdata  ext4    defaults,noatime,rw      wait,check,formattable
+/dev/block/platform/14700000.ufs/by-name/modem           /mnt/vendor/modem_img       ext4    ro,defaults,context=u:object_r:modem_img_file:s0,barrier=1    wait,slotselect
diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc
index 32c4157..0ca263f 100644
--- a/conf/init.gs101.rc
+++ b/conf/init.gs101.rc
@@ -16,6 +16,7 @@
 
 on early-init
     mount_all /vendor/etc/fstab.persist --early
+    mount_all /vendor/etc/fstab.modem --early
 
 on init
     # CPU0 cannot be offline
@@ -439,9 +440,6 @@
     setprop vendor.all.modules.ready 1
     setprop vendor.all.devices.ready 1
 
-    # Update dm-verity state and set partition.*.verified properties
-    verity_update_state
-
     # Permission for Health Storage HAL
     chown system system /dev/sys/block/bootdevice/manual_gc
 
@@ -652,6 +650,8 @@
     chown system system /sys/devices/virtual/sec/tsp/cmd
     chown system system /sys/devices/virtual/sec/tsp/cmd_result
     chown system system /sys/devices/virtual/sec/tsp/status
+    chown system system /sys/devices/virtual/input/nvt_touch/force_touch_active
+    chown system system /sys/devices/virtual/input/nvt_touch/nvt_dttw_mode
     # Allow access to touch
     chown system input /dev/touch_offload
     chmod 660 /dev/touch_offload
diff --git a/device.mk b/device.mk
index d900114..d731c69 100644
--- a/device.mk
+++ b/device.mk
@@ -251,6 +251,10 @@
 	fstab.gs101-fips.vendor_ramdisk
 PRODUCT_COPY_FILES += \
 	device/google/gs101/conf/fstab.persist:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.persist
+ifneq ($(BOARD_WITHOUT_RADIO),true)
+PRODUCT_COPY_FILES += \
+	device/google/gs101/conf/fstab.modem:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.modem
+endif
 
 # Shell scripts
 PRODUCT_COPY_FILES += \
@@ -271,7 +275,7 @@
 
 # Contexthub HAL
 PRODUCT_PACKAGES += \
-	android.hardware.contexthub@1.2-service.generic
+    android.hardware.contexthub-service.generic
 
 # CHRE tools
 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
@@ -342,6 +346,15 @@
 	frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
 
 # Sensors
+ifneq (,$(findstring tangor, $(TARGET_PRODUCT)))
+PRODUCT_COPY_FILES += \
+        frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
+        frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
+        frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
+        frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml\
+        frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
+        frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
+else
 PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
 	frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
@@ -352,6 +365,7 @@
 	frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
 	frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
 	frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml
+endif
 
 # Add sensor HAL 2.1 product packages
 PRODUCT_PACKAGES += android.hardware.sensors@2.1-service.multihal
@@ -499,6 +513,7 @@
 SOONG_CONFIG_NAMESPACES += lyric
 SOONG_CONFIG_lyric += \
 	use_lyric_camera_hal \
+	soc \
 	tuning_product
 
 SOONG_CONFIG_lyric_soc := gs101
@@ -757,7 +772,9 @@
 endif
 
 # GPS HAL
+ifeq (,$(filter tangor citron,$(subst _, ,$(TARGET_PRODUCT))))
 include device/google/gs101/gnss/device-gnss.mk
+endif
 
 # Trusty (KM, GK, Storage)
 $(call inherit-product, system/core/trusty/trusty-storage.mk)
@@ -778,10 +795,7 @@
 PRODUCT_PROPERTY_OVERRIDES += \
 	ro.frp.pst=/dev/block/by-name/frp
 
-# Bluetooth HAL
-PRODUCT_PACKAGES += \
-	android.hardware.bluetooth@1.1-service.bcmbtlinux \
-	bt_vendor.conf
+# Bluetooth
 PRODUCT_COPY_FILES += \
 	frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
 	frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml
@@ -851,7 +865,6 @@
 PRODUCT_PACKAGES += ShannonIms
 
 $(call inherit-product-if-exists, vendor/samsung_slsi/telephony/shannon-iwlan/device-vendor.mk)
-include device/google/gs101/telephony/pktrouter.mk
 
 #RCS Test Messaging App
 PRODUCT_PACKAGES_DEBUG += \
@@ -984,6 +997,12 @@
 
 SOONG_CONFIG_aoc_audio_board_platform := $(TARGET_BOARD_PLATFORM)
 
+SOONG_CONFIG_NAMESPACES += android_hardware_audio
+SOONG_CONFIG_android_hardware_audio += \
+	run_64bit
+
+SOONG_CONFIG_android_hardware_audio_run_64bit := true
+
 # Audio properties
 PRODUCT_PROPERTY_OVERRIDES += \
 	ro.config.vc_call_vol_steps=7 \
@@ -1050,8 +1069,13 @@
 	vendor.samsung_slsi.hardware.tetheroffload@1.1-service
 
 # pKVM
+$(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
+PRODUCT_BUILD_PVMFW_IMAGE := true
 ifeq ($(TARGET_PKVM_ENABLED),true)
-    $(call inherit-product, packages/modules/Virtualization/apex/product_packages.mk)
+    PRODUCT_PACKAGES += pkvm_enabler
+else
+    PRODUCT_COPY_FILES += \
+	    device/google/gs101/pkvm/pkvm_experiment.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/pkvm_experiment.rc
 endif
 
 # Enable watchdog timeout loop breaker.
@@ -1070,10 +1094,6 @@
     suspend.short_suspend_backoff_enabled=true \
     suspend.max_sleep_time_millis=40000
 
-# (b/183612348): Enable skia reduceOpsTaskSplitting
-PRODUCT_PROPERTY_OVERRIDES += \
-    renderthread.skia.reduceopstasksplitting=true
-
 # Enable Incremental on the device
 PRODUCT_PROPERTY_OVERRIDES += \
 	ro.incremental.enable=true
@@ -1087,6 +1107,9 @@
 # Telephony
 include device/google/gs101/telephony/user.mk
 
+# Wifi ext
+include hardware/google/pixel/wifi_ext/device.mk
+
 # Battery Stats Viewer
 PRODUCT_PACKAGES_DEBUG += BatteryStatsViewer
 
diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp
index 7b98f75..fd3ca20 100644
--- a/dumpstate/DumpstateDevice.cpp
+++ b/dumpstate/DumpstateDevice.cpp
@@ -214,6 +214,7 @@
     // sessions or starts a new session after the one with performance issues).
     dumpLogs(fd, kCameraLogDir, cameraDestDir, 10, "session-ended-");
     dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "high-drop-rate-");
+    dumpLogs(fd, kCameraLogDir, cameraDestDir, 5, "watchdog-");
 }
 
 timepoint_t startSection(int fd, const std::string &sectionName) {
@@ -249,6 +250,7 @@
 
 DumpstateDevice::DumpstateDevice()
   : mTextSections{
+        { "pre-touch", [this](int fd) { dumpPreTouchSection(fd); } },
         { "wlan", [this](int fd) { dumpWlanSection(fd); } },
         { "soc", [this](int fd) { dumpSocSection(fd); } },
         { "storage", [this](int fd) { dumpStorageSection(fd); } },
@@ -347,6 +349,9 @@
         DumpFileToFd(fd, "maxfg_base", "/dev/logbuffer_maxfg_base_monitor");
         DumpFileToFd(fd, "maxfg_flip", "/dev/logbuffer_maxfg_flip_monitor");
     }
+    if (!stat("/sys/class/power_supply/dock", &buffer)) {
+        DumpFileToFd(fd, "Power supply property dock", "/sys/class/power_supply/dock/uevent");
+    }
 
     if (!stat("/dev/logbuffer_tcpm", &buffer)) {
         DumpFileToFd(fd, "Logbuffer TCPM", "/dev/logbuffer_tcpm");
@@ -487,6 +492,10 @@
                    "for f in /sys/class/thermal/cooling* ; do "
                        "type=`cat $f/type` ; temp=`cat $f/cur_state` ; echo \"$type: $temp\" ; "
                        "done"});
+    RunCommandToFd(fd, "Cooling Device Time in State", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; "
+                   "do type=`cat $f/type` ; temp=`cat $f/stats/time_in_state_ms` ; echo \"$type:\n$temp\" ; done"});
+    RunCommandToFd(fd, "Cooling Device Trans Table", {"/vendor/bin/sh", "-c", "for f in /sys/class/thermal/cooling* ; "
+                   "do type=`cat $f/type` ; temp=`cat $f/stats/trans_table` ; echo \"$type:\n$temp\" ; done"});
     RunCommandToFd(fd, "Cooling Device State2Power Table", {"/vendor/bin/sh", "-c",
                    "for f in /sys/class/thermal/cooling* ; do "
                        "type=`cat $f/type` ; state2power_table=`cat $f/state2power_table` ; echo \"$type: $state2power_table\" ; "
@@ -494,6 +503,42 @@
 }
 
 // Dump items related to touch
+void DumpstateDevice::dumpPreTouchSection(int fd) {
+    const char nvt_spi_path[] = "/sys/devices/virtual/input/nvt_touch";
+    char cmd[256];
+
+    /* NVT touch */
+    if (!access(nvt_spi_path, R_OK)) {
+        snprintf(cmd, sizeof(cmd),
+                 "echo %s > %s/%s",
+                 "0x21",
+                 nvt_spi_path,
+                 "force_touch_active");
+        RunCommandToFd(fd, "Force Touch Active(Enable)", {"/vendor/bin/sh", "-c", cmd});
+
+        snprintf(cmd, sizeof(cmd), "/proc/nvt_fw_version");
+        if (!access(cmd, R_OK))
+            DumpFileToFd(fd, "FW version", cmd);
+
+#if 0	/* b/193467774: remove this temporarily */
+        snprintf(cmd, sizeof(cmd), "/proc/nvt_diff");
+        if (!access(cmd, R_OK))
+            DumpFileToFd(fd, "Diff", cmd);
+
+        snprintf(cmd, sizeof(cmd), "%s/nvt_fw_history", nvt_spi_path);
+        if (!access(nvt_spi_path, R_OK))
+            DumpFileToFd(fd, "FW History", cmd);
+#endif
+
+        snprintf(cmd, sizeof(cmd),
+                 "echo %s > %s/%s",
+                 "0x20",
+                 nvt_spi_path,
+                 "force_touch_active");
+        RunCommandToFd(fd, "Force Touch Active(Disable)", {"/vendor/bin/sh", "-c", cmd});
+    }
+}
+
 void DumpstateDevice::dumpTouchSection(int fd) {
     const char stm_cmd_path[4][50] = {"/sys/class/spi_master/spi11/spi11.0",
                                       "/proc/fts/driver_test",
@@ -972,6 +1017,7 @@
 void DumpstateDevice::dumpGscSection(int fd) {
     RunCommandToFd(fd, "Citadel VERSION", {"vendor/bin/hw/citadel_updater", "-lv"});
     RunCommandToFd(fd, "Citadel STATS", {"vendor/bin/hw/citadel_updater", "--stats"});
+    RunCommandToFd(fd, "GSC DEBUG DUMP", {"vendor/bin/hw/citadel_updater", "-D"});
 }
 
 // Dump essential camera debugging logs
diff --git a/dumpstate/DumpstateDevice.h b/dumpstate/DumpstateDevice.h
index 74d0ce1..5cc3249 100644
--- a/dumpstate/DumpstateDevice.h
+++ b/dumpstate/DumpstateDevice.h
@@ -64,6 +64,7 @@
     void dumpWlanSection(int fd);
     void dumpPowerSection(int fd);
     void dumpThermalSection(int fd);
+    void dumpPreTouchSection(int fd);
     void dumpTouchSection(int fd);
     void dumpSocSection(int fd);
     void dumpCpuSection(int fd);
diff --git a/edgetpu/OWNERS b/edgetpu/OWNERS
new file mode 100644
index 0000000..9eb92a9
--- /dev/null
+++ b/edgetpu/OWNERS
@@ -0,0 +1,6 @@
+# Devs who work on EdgeTPU on Android.
+hsuy@google.com
+yuchicheng@google.com
+iayara@google.com
+qinyiyan@google.com
+macwang@google.com
\ No newline at end of file
diff --git a/pixelstats/pixelstats-vendor.gs101.rc b/pixelstats/pixelstats-vendor.gs101.rc
index 98af5fc..d324b6a 100644
--- a/pixelstats/pixelstats-vendor.gs101.rc
+++ b/pixelstats/pixelstats-vendor.gs101.rc
@@ -1,5 +1,5 @@
 on property:sys.boot_completed=1
-    start vendor.pixelstats_vendor
+	start vendor.pixelstats_vendor
 
 service vendor.pixelstats_vendor /vendor/bin/pixelstats-vendor
     class hal
diff --git a/pkvm/Android.bp b/pkvm/Android.bp
new file mode 100644
index 0000000..dba9601
--- /dev/null
+++ b/pkvm/Android.bp
@@ -0,0 +1,31 @@
+// Copyright (C) 2021 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.
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "//device/google/gs101:device_google_gs101_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: [
+        "//device/google/gs101:device_google_gs101_license",
+    ],
+}
+
+cc_binary {
+    name: "pkvm_enabler",
+    vendor: true,
+    init_rc: ["pkvm_enabler.gs101.rc"],
+    srcs: ["pkvm_enabler.c"],
+    shared_libs: ["liblog"],
+}
diff --git a/pkvm/pkvm_enabler.c b/pkvm/pkvm_enabler.c
new file mode 100644
index 0000000..cb14ba6
--- /dev/null
+++ b/pkvm/pkvm_enabler.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#define LOG_TAG     "pkvm_enabler"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#include <log/log.h>
+
+#define KVM_DEVICE  "/dev/kvm"
+#define MISC_WRITER "/vendor/bin/misc_writer"
+
+int main() {
+    char *newargv[] = { MISC_WRITER, "--set-enable-pkvm", NULL };
+    char *newenvp[] = { NULL };
+    pid_t pid;
+    int ret, wstatus;
+
+    /* Check whether KVM device exists. */
+    ret = access(KVM_DEVICE, F_OK);
+
+    /* If KVM device exists, return SUCCESS to continue booting. */
+    if (ret == 0) {
+        exit(EXIT_SUCCESS);
+    }
+
+    if (ret != -ENOENT) {
+        ALOGW("Unexpected error from access(): %d", ret);
+    }
+
+    /*
+     * If KVM device does not exist, run misc_writer and return FAILURE
+     * to force a reboot.
+     */
+    pid = fork();
+    if (pid == -1) {
+        ALOGE("Could not fork: %d", errno);
+        exit(EXIT_FAILURE);
+    }
+
+    if (pid == 0) {
+        execve(MISC_WRITER, newargv, newenvp);
+        ALOGE("Could not execute " MISC_WRITER ": %d", errno);
+        _exit(EXIT_FAILURE);
+    }
+
+    waitpid(pid, &wstatus, 0);
+    if (WIFEXITED(wstatus)) {
+        ret = WEXITSTATUS(wstatus);
+        if (ret) {
+            ALOGE(MISC_WRITER " exit status: %d", ret);
+        }
+    } else {
+        ALOGE(MISC_WRITER " terminated unexpectedly: %d", wstatus);
+    }
+
+    exit(EXIT_FAILURE);
+}
diff --git a/pkvm/pkvm_enabler.gs101.rc b/pkvm/pkvm_enabler.gs101.rc
new file mode 100644
index 0000000..6f329d3
--- /dev/null
+++ b/pkvm/pkvm_enabler.gs101.rc
@@ -0,0 +1,5 @@
+service pkvm_enabler /vendor/bin/pkvm_enabler
+    reboot_on_failure reboot,pkvm-not-enabled
+
+on early-init
+    exec_start pkvm_enabler
\ No newline at end of file
diff --git a/pkvm/pkvm_experiment.rc b/pkvm/pkvm_experiment.rc
new file mode 100644
index 0000000..148f084
--- /dev/null
+++ b/pkvm/pkvm_experiment.rc
@@ -0,0 +1,13 @@
+service vendor.pkvm_enable /vendor/bin/misc_writer --set-enable-pkvm
+    disabled
+    oneshot
+
+service vendor.pkvm_disable /vendor/bin/misc_writer --set-disable-pkvm
+    disabled
+    oneshot
+
+on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=true
+    start vendor.pkvm_enable
+
+on property:persist.device_config.virtualization_framework_native.isolated_compilation_enabled=false
+    start vendor.pkvm_disable
diff --git a/powerhint.json b/powerhint.json
index 6c9f31e..66ebf02 100644
--- a/powerhint.json
+++ b/powerhint.json
@@ -26,7 +26,11 @@
         "9999999",
         "1098000",
         "1401000",
-        "1197000"
+        "930000",
+        "1197000",
+        "1328000",
+        "1598000",
+        "1803000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -48,8 +52,12 @@
         "9999999",
         "1024000",
         "1197000",
-        "1999000",
-        "1491000"
+        "1491000",
+        "910000",
+        "1328000",
+        "1663000",
+        "1836000",
+        "1999000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -71,7 +79,12 @@
         "9999999",
         "984000",
         "1426000",
-        "1826000"
+        "1826000",
+        "1277000",
+        "1582000",
+        "1745000",
+        "2048000",
+        "2401000"
       ],
       "DefaultIndex": 0,
       "ResetOnInit": true
@@ -1033,6 +1046,96 @@
       "Value": "9999999"
     },
     {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_50",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "930000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_60",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1197000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_70",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1328000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_80",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1598000"
+    },
+    {
+      "PowerHint": "LOW_POWER_LITTLE_CLUSTER_90",
+      "Node": "CPULittleClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1803000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_50",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "910000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_60",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1328000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_70",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1663000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_80",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1836000"
+    },
+    {
+      "PowerHint": "LOW_POWER_MID_CLUSTER_90",
+      "Node": "CPUMidClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1999000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_50",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1277000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_60",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1582000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_70",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "1745000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_80",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "2048000"
+    },
+    {
+      "PowerHint": "LOW_POWER_CPU_90",
+      "Node": "CPUBigClusterMaxFreq",
+      "Duration": 3600000,
+      "Value": "2401000"
+    },
+    {
       "PowerHint": "REFRESH_120FPS",
       "Node": "TAUClampBoost",
       "Duration": 0,
diff --git a/powerstats/Gs101CommonDataProviders.cpp b/powerstats/Gs101CommonDataProviders.cpp
index e156b7b..98cdb85 100644
--- a/powerstats/Gs101CommonDataProviders.cpp
+++ b/powerstats/Gs101CommonDataProviders.cpp
@@ -613,7 +613,7 @@
 
     p->addEnergyConsumer(PowerStatsEnergyConsumer::createMeterAndAttrConsumer(p,
             EnergyConsumerType::OTHER, "TPU", {"S10M_VDD_TPU"},
-            {{UID_TIME_IN_STATE, "/sys/class/edgetpu/abrolhos/device/tpu_usage"}},
+            {{UID_TIME_IN_STATE, "/sys/class/edgetpu/edgetpu-soc/device/tpu_usage"}},
             stateCoeffs));
 }
 
diff --git a/rro_overlays/WifiOverlay/res/values/config.xml b/rro_overlays/WifiOverlay/res/values/config.xml
index 4e5d4bf..090df9e 100644
--- a/rro_overlays/WifiOverlay/res/values/config.xml
+++ b/rro_overlays/WifiOverlay/res/values/config.xml
@@ -132,4 +132,7 @@
     <bool translatable="false" name="config_wifiDefaultCoexAlgorithmEnabled">true</bool>
     <!-- Whether to use the explicit vendor HAL API: IWifiStaIface.setRoamingState for disabling fw roaming. -->
     <bool translatable="false" name="config_wifiUseHalApiToDisableFwRoaming">true</bool>
+
+    <!-- Indicate the driver doesn't support NL80211 Reg changed event -->
+    <bool translatable="false" name="config_wifiDriverSupportedNl80211RegChangedEvent">false</bool>
 </resources>
diff --git a/vendor_dlkm.blocklist b/vendor_dlkm.blocklist
index b259ab6..4f7b6fd 100644
--- a/vendor_dlkm.blocklist
+++ b/vendor_dlkm.blocklist
@@ -1,4 +1,5 @@
 blocklist bcmdhd43752
+blocklist synadhd43752
 blocklist bcmdhd4389
 blocklist cl_dsp
 blocklist drv2624
diff --git a/wifi/BoardConfig-wifi.mk b/wifi/BoardConfig-wifi.mk
new file mode 100644
index 0000000..da50209
--- /dev/null
+++ b/wifi/BoardConfig-wifi.mk
@@ -0,0 +1,32 @@
+#
+# Copyright (C) 2021 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.
+#
+
+# WiFi
+BOARD_WLAN_DEVICE := bcmdhd
+BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
+WPA_SUPPLICANT_VERSION := VER_0_8_X
+BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+BOARD_HOSTAPD_DRIVER := NL80211
+# Wifi interface combination - {1 STA + 1 AP (bridged or single)} or {1 STA + 1 P2P}
+# or {1 STA + 1 NAN} or {2 STA}
+WIFI_HAL_INTERFACE_COMBINATIONS := {{{STA}, 1}, {{P2P, NAN, AP}, 1}}, {{{STA}, 2}}
+WIFI_FEATURE_WIFI_EXT_HAL := true
+WIFI_FEATURE_IMU_DETECTION := true
+# Avoid Wifi reset on MAC Address change
+WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
+WIFI_FEATURE_HOSTAPD_11AX := true
+