aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-06-19 15:04:13 +0200
committerJoonas Kylmälä <joonas.kylmala@iki.fi>2020-04-09 13:39:48 -0400
commit6b0758e8c45314422c29e12ef2019ff1b2208d00 (patch)
tree4a8ca745428c59269705a40d392f3d14799b6edd
parent0e6ea95f23a5e27834d43ba580457f16106f2d42 (diff)
downloaddevice_samsung_i9300-6b0758e8c45314422c29e12ef2019ff1b2208d00.tar.gz
device_samsung_i9300-6b0758e8c45314422c29e12ef2019ff1b2208d00.tar.bz2
device_samsung_i9300-6b0758e8c45314422c29e12ef2019ff1b2208d00.zip
HACK: Add userspace support for i9300
This is to add the least amount of changes to add support for the i9300. The changes were first shared with i9305 but that had several issues: - We don't support the modem yet on the i9305 - The partitions are different, but the i9300 kernel can be built separately by hand, to keep changes minimal. - Right now we also support the stock bootloader as u-boot still requires shipping nonfree software. This requires to hardcode the dtb. To use a single repository, we would need to: - Have a free software u-boot. If it's not possible to replace the nonfree BL1, we could still make an u-boot version that can be instealled instead of the kernel and use that to handle the different dtbs. - Add support for the i9305 modem through the ofono ril. - Add support for libsamsung-ipc in ofono. Addding a replicant_common repository would also require more work, so it can be done later. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> Rebased for Replicant 10 Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
-rw-r--r--AndroidProducts.mk2
-rw-r--r--BoardConfig.mk7
-rw-r--r--README.md6
-rw-r--r--audio/Android.mk4
-rw-r--r--audio/audio_hw.c4
-rw-r--r--device.mk12
-rw-r--r--gatekeeper/Android.mk2
-rw-r--r--gatekeeper/SoftGateKeeperDevice.cpp4
-rw-r--r--gatekeeper/SoftGateKeeperDevice.h2
-rw-r--r--gatekeeper/module.cpp16
-rw-r--r--init.smdk4x12.rc2
-rw-r--r--lineage_i9300.mk (renamed from lineage_i9305.mk)10
-rw-r--r--vendorsetup.sh3
13 files changed, 38 insertions, 36 deletions
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 37e30b4..b168b09 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -15,4 +15,4 @@
#
PRODUCT_MAKEFILES := \
- $(LOCAL_DIR)/lineage_i9305.mk
+ $(LOCAL_DIR)/lineage_i9300.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
index adc5878..ca3d655 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -39,10 +39,10 @@ BOARD_VENDOR := samsung
TARGET_KERNEL_SOURCE := kernel/replicant/linux
TARGET_KERNEL_CONFIG := replicant_defconfig
BOARD_KERNEL_IMAGE_NAME := zImage-dtb
-BOARD_DTB_IMAGE_NAME := exynos4412-i9305.dtb
+BOARD_DTB_IMAGE_NAME := exynos4412-i9300.dtb
# Recover
-TARGET_RECOVERY_FSTAB := device/samsung/i9305/fstab.smdk4x12
+TARGET_RECOVERY_FSTAB := device/samsung/i9300/fstab.smdk4x12
BOARD_USES_FULL_RECOVERY_IMAGE := false
BOARD_USES_RECOVERY_AS_BOOT := false
@@ -75,6 +75,7 @@ BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BOARD_USES_GENERIC_AUDIO := true
-DEVICE_MANIFEST_FILE := device/samsung/i9305/manifest.xml
+
+DEVICE_MANIFEST_FILE := device/samsung/i9300/manifest.xml
USE_XML_AUDIO_POLICY_CONF := 1
diff --git a/README.md b/README.md
index 4888f71..777fad5 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
-# Device tree for Samsung Galaxy SIII 4G (GT-I9305)
+# Device tree for Samsung Galaxy SIII (GT-I9300)
Run the following commands to build AOSP:
`
. build/envsetup.sh
-lunch lineage_i9305-eng
+lunch lineage_i9300-eng
make -j9
`
Run the following command to test the built image:
-`heimdall flash --BOOT out/target/product/i9305/boot.img --SYSTEM out/target/product/i9305/system.img`
+`heimdall flash --BOOT out/target/product/i9300/boot.img --SYSTEM out/target/product/i9300/system.img`
# License
diff --git a/audio/Android.mk b/audio/Android.mk
index 7db7659..57fb423 100644
--- a/audio/Android.mk
+++ b/audio/Android.mk
@@ -18,7 +18,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := audio.primary.i9305
+LOCAL_MODULE := audio.primary.i9300
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
@@ -41,7 +41,7 @@ include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := audio.primary.i9305_legacy
+LOCAL_MODULE := audio.primary.i9300_legacy
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 62a2daa..61f49c3 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -1656,10 +1656,10 @@ fallback_init(void)
ALOGD("Emulator without host-side ALSA audio emulation detected.");
#if __LP64__
- module = dlopen("/vendor/lib64/hw/audio.primary.i9305_legacy.so",
+ module = dlopen("/vendor/lib64/hw/audio.primary.i9300_legacy.so",
RTLD_LAZY|RTLD_LOCAL);
#else
- module = dlopen("/vendor/lib/hw/audio.primary.i9305_legacy.so",
+ module = dlopen("/vendor/lib/hw/audio.primary.i9300_legacy.so",
RTLD_LAZY|RTLD_LOCAL);
#endif
if (module != NULL) {
diff --git a/device.mk b/device.mk
index dfe027e..a34a6aa 100644
--- a/device.mk
+++ b/device.mk
@@ -114,8 +114,8 @@ PRODUCT_PACKAGES += \
android.hardware.drm@1.0-service \
PRODUCT_COPY_FILES += \
- device/samsung/i9305/fstab.smdk4x12:root/fstab.smdk4x12 \
- device/samsung/i9305/init.smdk4x12.rc:root/init.smdk4x12.rc \
+ device/samsung/i9300/fstab.smdk4x12:root/fstab.smdk4x12 \
+ device/samsung/i9300/init.smdk4x12.rc:root/init.smdk4x12.rc \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.software.app_widgets.xml:system/etc/permissions/android.software.app_widgets.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
@@ -126,7 +126,7 @@ PRODUCT_COPY_FILES += \
# Get root on the serial console for -eng builds
# This can help debugging early boot issues
ifeq ($(TARGET_BUILD_VARIANT),eng)
-PRODUCT_COPY_FILES += device/samsung/i9305/console.rc:system/etc/init/console.rc
+PRODUCT_COPY_FILES += device/samsung/i9300/console.rc:system/etc/init/console.rc
endif
# ADB support
@@ -138,10 +138,10 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PACKAGES += gatekeeper.default
# Enable flashing through heimdall
-PRODUCT_COPY_FILES += device/samsung/i9305/resize2fs_partitions.sh:system/bin/resize2fs_partitions.sh
+PRODUCT_COPY_FILES += device/samsung/i9300/resize2fs_partitions.sh:system/bin/resize2fs_partitions.sh
# HACK: prevent the device to go in suspend because it's annoying during early
# development. Remove afterward as it consume way more energy this way.
-PRODUCT_COPY_FILES += device/samsung/i9305/prevent_suspend.sh:system/bin/prevent_suspend.sh
-PRODUCT_COPY_FILES += device/samsung/i9305/prevent_suspend.rc:system/etc/init/prevent_suspend.rc
+PRODUCT_COPY_FILES += device/samsung/i9300/prevent_suspend.sh:system/bin/prevent_suspend.sh
+PRODUCT_COPY_FILES += device/samsung/i9300/prevent_suspend.rc:system/etc/init/prevent_suspend.rc
diff --git a/gatekeeper/Android.mk b/gatekeeper/Android.mk
index 823bd2b..3077312 100644
--- a/gatekeeper/Android.mk
+++ b/gatekeeper/Android.mk
@@ -18,7 +18,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE := gatekeeper.default
+LOCAL_MODULE := gatekeeper.i9300
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_CFLAGS := -Wall -Wextra -Werror -Wunused
diff --git a/gatekeeper/SoftGateKeeperDevice.cpp b/gatekeeper/SoftGateKeeperDevice.cpp
index a504fba..f00e385 100644
--- a/gatekeeper/SoftGateKeeperDevice.cpp
+++ b/gatekeeper/SoftGateKeeperDevice.cpp
@@ -16,7 +16,7 @@
#include "SoftGateKeeper.h"
#include "SoftGateKeeperDevice.h"
-namespace i9305 {
+namespace i9300 {
int SoftGateKeeperDevice::enroll(uint32_t uid,
const uint8_t *current_password_handle, uint32_t current_password_handle_length,
@@ -113,4 +113,4 @@ int SoftGateKeeperDevice::verify(uint32_t uid,
return 0;
}
-} // namespace i9305
+} // namespace i9300
diff --git a/gatekeeper/SoftGateKeeperDevice.h b/gatekeeper/SoftGateKeeperDevice.h
index 05aceaa..7799b16 100644
--- a/gatekeeper/SoftGateKeeperDevice.h
+++ b/gatekeeper/SoftGateKeeperDevice.h
@@ -23,7 +23,7 @@
using namespace gatekeeper;
-namespace i9305 {
+namespace i9300 {
/**
* Software based GateKeeper implementation
diff --git a/gatekeeper/module.cpp b/gatekeeper/module.cpp
index a3d678c..5053fc4 100644
--- a/gatekeeper/module.cpp
+++ b/gatekeeper/module.cpp
@@ -26,14 +26,14 @@
#include "SoftGateKeeper.h"
#include "SoftGateKeeperDevice.h"
-using i9305::SoftGateKeeperDevice;
+using i9300::SoftGateKeeperDevice;
-struct i9305_gatekeeper_device {
+struct i9300_gatekeeper_device {
gatekeeper_device device;
SoftGateKeeperDevice *s_gatekeeper;
};
-static i9305_gatekeeper_device s_device;
+static i9300_gatekeeper_device s_device;
static int enroll(const struct gatekeeper_device *dev __unused, uint32_t uid,
const uint8_t *current_password_handle, uint32_t current_password_handle_length,
@@ -41,7 +41,7 @@ static int enroll(const struct gatekeeper_device *dev __unused, uint32_t uid,
const uint8_t *desired_password, uint32_t desired_password_length,
uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length) {
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
+ SoftGateKeeperDevice *s_gatekeeper = ((i9300_gatekeeper_device*)(dev))->s_gatekeeper;
ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, dev);
if (s_gatekeeper == nullptr) {
abort();
@@ -59,7 +59,7 @@ static int verify(const struct gatekeeper_device *dev __unused, uint32_t uid, ui
const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
const uint8_t *provided_password, uint32_t provided_password_length,
uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll) {
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
+ SoftGateKeeperDevice *s_gatekeeper = ((i9300_gatekeeper_device*)(dev))->s_gatekeeper;
ALOGE("called %s with gate keeper %p device %p\n", __func__, s_gatekeeper, dev);
if (s_gatekeeper == nullptr) return -EINVAL;
return s_gatekeeper->verify(uid, challenge,
@@ -69,7 +69,7 @@ static int verify(const struct gatekeeper_device *dev __unused, uint32_t uid, ui
}
static int close_device(hw_device_t* dev __unused) {
- SoftGateKeeperDevice *s_gatekeeper = ((i9305_gatekeeper_device*)(dev))->s_gatekeeper;
+ SoftGateKeeperDevice *s_gatekeeper = ((i9300_gatekeeper_device*)(dev))->s_gatekeeper;
if (s_gatekeeper == nullptr) return 0;
delete s_gatekeeper;
s_gatekeeper = nullptr;
@@ -77,7 +77,7 @@ static int close_device(hw_device_t* dev __unused) {
return 0;
}
-static int i9305_gatekeeper_open(const hw_module_t *module, const char *name,
+static int i9300_gatekeeper_open(const hw_module_t *module, const char *name,
hw_device_t **device) {
if (strcmp(name, HARDWARE_GATEKEEPER) != 0) {
@@ -109,7 +109,7 @@ static int i9305_gatekeeper_open(const hw_module_t *module, const char *name,
}
static struct hw_module_methods_t gatekeeper_module_methods = {
- .open = i9305_gatekeeper_open,
+ .open = i9300_gatekeeper_open,
};
struct gatekeeper_module HAL_MODULE_INFO_SYM __attribute__((visibility("default"))) = {
diff --git a/init.smdk4x12.rc b/init.smdk4x12.rc
index 35a465c..5a45def 100644
--- a/init.smdk4x12.rc
+++ b/init.smdk4x12.rc
@@ -16,7 +16,7 @@
on boot
# Audio support
- setprop ro.hardware.audio.primary i9305
+ setprop ro.hardware.audio.primary i9300
# adb support
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
diff --git a/lineage_i9305.mk b/lineage_i9300.mk
index 63b1565..12ba55b 100644
--- a/lineage_i9305.mk
+++ b/lineage_i9300.mk
@@ -16,14 +16,14 @@
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk)
-$(call inherit-product, device/samsung/i9305/device.mk)
-$(call inherit-product, vendor/lineage/config/common_full.mk)
+$(call inherit-product, device/samsung/i9300/device.mk)
+$(call inherit-product, vendor/lineage/config/common_phone.mk)
$(call inherit-product, hardware/samsung/Android.mk)
-PRODUCT_NAME := lineage_i9305
-PRODUCT_DEVICE := i9305
+PRODUCT_NAME := lineage_i9300
+PRODUCT_DEVICE := i9300
PRODUCT_BRAND := Samsung
-PRODUCT_MODEL := Lineage on i9305
+PRODUCT_MODEL := Lineage on i9300
PRODUCT_MANUFACTURER := Samsung
# Disable A/B update
diff --git a/vendorsetup.sh b/vendorsetup.sh
index bf5fcfb..d21fbce 100644
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -14,4 +14,5 @@
# limitations under the License.
#
-add_lunch_combo lineage_i9305-userdebug
+add_lunch_combo lineage_i9300-userdebug
+add_lunch_combo lineage_i9300-userdebug