Permalink
Browse files

second set towards aosp toroplus

Bug: 6940653
Change-Id: I2750ea8cf70e73320710892b1feaef2bbef91a7b
Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
  • Loading branch information...
1 parent 5ff5ce7 commit 98773c8cfeef655fa63d95134c94b5a79d18eb35 Madan Ankapura committed with Jean-Baptiste Queru Sep 9, 2012
Showing with 479 additions and 4 deletions.
  1. +9 −0 BoardConfig.mk
  2. +117 −0 bcmdhd.cal
  3. +6 −3 device.mk
  4. +18 −0 recovery/Android.mk
  5. +53 −0 recovery/recovery_updater.c
  6. +109 −0 recovery/update_cdma_modem.c
  7. +22 −0 recovery/update_cdma_modem.h
  8. +144 −0 releasetools.py
  9. +1 −1 system.prop
View
@@ -22,3 +22,12 @@ TARGET_BOARD_INFO_FILE ?= device/samsung/toroplus/board-info.txt
# Use the part that is common between all tunas
include device/samsung/tuna/BoardConfig.mk
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 30691799040
+
+# Use/add toroplus-specific variants
+TARGET_RECOVERY_UPDATER_LIBS += librecovery_updater_toroplus
+TARGET_RELEASETOOLS_EXTENSIONS := device/samsung/toroplus
+
+# on toroplus boards we need to apply a special adaptive filter
+# on the compass output because of noise generated by the pmic.
+BOARD_INVENSENSE_APPLY_COMPASS_NOISE_FILTER := true
View
@@ -0,0 +1,117 @@
+# BCM4330 B2 FCBGA SS Proxima VZW Rev1.1 12/08/2011 Calibrated verified with 125.84.4 //
+manfid=0x2d0
+prodid=0x0532
+vendid=0x14e4
+devid=0x4360
+boardtype=0x0532
+boardrev=0x40
+#boardflags: has ext 5GHz lna, use a SP3T sw share with BT, 2.4GHz iLNA and iPA
+boardflags=0x10081201
+nocrc=1
+xtalfreq=37400
+boardnum=21
+macaddr=00:90:4c:c5:12:38
+ag0=0
+# aa2g=1 means by default only one antenna, MAIN RF.
+aa2g=1
+aa5g=1
+ccode=US
+regrev=69
+# 2.4GHz PA parameters are preliminary
+pa0b0=0x1491
+pa0b1=0xFD9D
+pa0b2=0xFF64
+cckPwrOffset=4
+# rssi params for 2.4GHz
+rssismf2g=0xa
+rssismc2g=0x3
+rssisav2g=0x7
+# rssi params for 5GHz
+rssismf5g=0xa
+rssismc5g=0x7
+rssisav5g=0x1
+#PA parameters for lower a-band: CH.36 (5180M) - CH.64 (5320M)
+pa1lob0=0x14B9
+pa1lob1=0xFD79
+pa1lob2=0xFF59
+#PA parameters for midband: CH.100 (5500M) - CH.140 (5700M)
+pa1b0=0x14C5
+pa1b1=0xFD72
+pa1b2=0xFF54
+#PA parameters for high band: CH.149 (5745M) - CH.165 (5825M)
+pa1hib0=0x148E
+pa1hib1=0xFD6B
+pa1hib2=0xFF49
+sromrev=3
+# 2.4G Tx Power: 17/14/13
+maxp2ga0=74
+ofdm2gpo=0x66666666
+mcs2gpo0=0x8888
+mcs2gpo1=0x8888
+# 5G Tx Power: 14/13
+maxp5ga0=74
+maxp5gla0=74
+maxp5gha0=74
+ofdm5gpo=0x66666666
+ofdm5glpo=0x66666666
+ofdm5ghpo=0x66666666
+mcs5gpo0=0x8888
+mcs5gpo1=0x8888
+mcs5glpo0=0x8888
+mcs5glpo1=0x8888
+mcs5ghpo0=0x8888
+mcs5ghpo1=0x8888
+#il0macaddr=00:90:4c:c5:12:38
+#wl0id=0x431b
+# support A band ext PA
+extpagain5g=2
+
+#rfreg033=0x1f
+rfreg033=0x19
+rfreg033_cck=0x1f
+cckdigfilttype=22
+
+txalpfbyp2g=1
+#txalpfbyp2g_cck=0
+bphyscale=17
+
+pacalidx2g=65
+dacrate2g=160
+
+# 2G Murata FEM
+swctrlmap_2g=0x04040404,0x0a0a0202,0x0c0c0404,0x010a02,0x1ff
+# 5G Murata MDFE2PFA-023
+swctrlmap_5g=0x90909090,0x60602020,0x50502020,0x010a02,0X2f8
+
+#triso5g=9
+tridx5g=0
+noise_cal_po_2g=-3
+noise_cal_ref_2g=52
+pa0itssit=0x20
+# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
+# muxenab=0x2
+# tssitime=1
+
+txiqlopapu5g=1
+txiqlopag5g=0x10
+iqlocalidx5g=32
+
+sd_gpout=0
+# sd_oobonly=1
+muxenab=0x10
+
+btc_params8=10000
+btc_params80=0
+btc_params6=10
+
+# 5G +/-160MHz Spur
+txgaintbl5g=1
+
+# 5G 1.7G Spur
+loidacmode5g=1
+
+# 2.4G ACR
+rxgaintbl100=1
+
+# 5GHz Starting Tx Gain Index
+initxidx5g=96
View
@@ -12,17 +12,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This file includes all definitions that apply only to maguro devices
+# This file includes all definitions that apply only to toroplus device
#
# Anything that is generic to all tuna products should go in the tuna directory
#
# Everything in this directory will become public
DEVICE_PACKAGE_OVERLAYS := device/samsung/toroplus/overlay
-# These are the hardware-specific features
-PRODUCT_COPY_FILES := \
+PRODUCT_COPY_FILES += \
+ device/samsung/toroplus/bcmdhd.cal:system/etc/wifi/bcmdhd.cal \
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.config.vc_call_vol_steps=7
+
$(call inherit-product, device/samsung/tuna/device.mk)
$(call inherit-product-if-exists, vendor/samsung/toroplus/device-vendor.mk)
View
@@ -0,0 +1,18 @@
+LOCAL_PATH := $(call my-dir)
+
+ifneq (,$(findstring $(TARGET_DEVICE),toroplus))
+
+# Edify extension functions for doing modem (radio) updates on toroplus devices.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_C_INCLUDES += bootable/recovery
+LOCAL_SRC_FILES := recovery_updater.c update_cdma_modem.c
+
+# should match TARGET_RECOVERY_UPDATER_LIBS set in BoardConfig.mk
+LOCAL_MODULE := librecovery_updater_toroplus
+
+include $(BUILD_STATIC_LIBRARY)
+
+endif
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "edify/expr.h"
+#include "update_cdma_modem.h"
+
+Value* UpdateCdmaModemFn(const char* name, State* state, int argc, Expr* argv[])
+{
+ int result = -1;
+ Value* img;
+
+ if (argc != 1) {
+ return ErrorAbort(state, "%s() expects 1 arg, got %d", name, argc);
+ }
+
+ if (ReadValueArgs(state, argv, 1, &img) < 0) {
+ return NULL;
+ }
+
+ if(img->type != VAL_BLOB) {
+ FreeValue(img);
+ return ErrorAbort(state, "%s(): argument types are incorrect", name);
+ }
+
+ result = update_cdma_modem(img->data, img->size);
+ FreeValue(img);
+ return StringValue(strdup(result == 0 ? "t" : ""));
+}
+
+void Register_librecovery_updater_toroplus() {
+ fprintf(stderr, "installing samsung updater extensions for toroplus\n");
+
+ RegisterFunction("samsung.update_cdma_modem", UpdateCdmaModemFn);
+}
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <linux/usbdevice_fs.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+#include <termios.h>
+
+#include "update_cdma_modem.h"
+
+
+#define MODEM_DEVNODE "/dev/cdma_boot0"
+
+#define IOCTL_MODEM_ON _IO('o', 0x19)
+#define IOCTL_MODEM_OFF _IO('o', 0x20)
+#define IOCTL_MODEM_RESET _IO('o', 0x21)
+#define IOCTL_MODEM_BOOT_ON _IO('o', 0x22)
+#define IOCTL_MODEM_BOOT_OFF _IO('o', 0x23)
+#define IOCTL_MODEM_START _IO('o', 0x24)
+#define IOCTL_MODEM_SEND _IO('o', 0x25)
+#define IOCTL_MODEM_RECV _IO('o', 0x26)
+#define IOCTL_MODEM_STATUS _IO('o', 0x27)
+#define IOCTL_MODEM_GOTA_START _IO('o', 0x28)
+#define IOCTL_MODEM_FW_UPDATE _IO('o', 0x29)
+
+/* buffer type for modem image */
+struct dpram_firmware {
+ char *firmware;
+ int size;
+ int is_delta;
+};
+
+static int modem_download_ioctl_fw(int sel, struct dpram_firmware* fw)
+{
+ int fd = open(MODEM_DEVNODE, O_RDWR);
+ if (fd < 0) {
+ fprintf(stderr, "Unable to open modem device (%s)\n", strerror(errno));
+ return -1;
+ }
+ int ret = (fw != NULL) ? ioctl(fd, sel, fw) : ioctl(fd, sel);
+ close(fd);
+
+ return ret;
+}
+
+static int modem_download_ioctl(int sel)
+{
+ return modem_download_ioctl_fw(sel, NULL);
+}
+
+int update_cdma_modem(const char* image_data, size_t image_size) {
+ int ret;
+ struct dpram_firmware fw;
+
+ ret = modem_download_ioctl(IOCTL_MODEM_GOTA_START);
+ if (ret < 0) {
+ fprintf(stderr, "IOCTL_MODEM_GOTA_START failed: (%d)\n", ret);
+ return -1;
+ }
+
+ ret = modem_download_ioctl(IOCTL_MODEM_BOOT_ON);
+ if (ret < 0) {
+ fprintf(stderr, "IOCTL_MODEM_BOOT_ON failed: (%d)\n", ret);
+ return -1;
+ }
+
+ fw.firmware = image_data;
+ fw.size = image_size;
+ fw.is_delta = 0;
+
+ ret = modem_download_ioctl_fw(IOCTL_MODEM_FW_UPDATE, &fw);
+ if (ret < 0) {
+ fprintf(stderr, "IOCTL_MODEM_FW_UPDATE failed: (%d)\n", ret);
+ return -1;
+ }
+
+ ret = modem_download_ioctl(IOCTL_MODEM_BOOT_OFF);
+ if (ret < 0) {
+ fprintf(stderr, "IOCTL_MODEM_BOOT_OFF failed: (%d)\n", ret);
+ return -1;
+ }
+
+ printf("Firmware update was successful\n");
+
+ return 0;
+}
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+#ifndef __UPDATE_CDMA_MODEM_H__
+#define __UPDATE_CDMA_MODEM_H__
+
+int update_cdma_modem(const char* image_data, size_t image_size);
+
+#endif
Oops, something went wrong.

0 comments on commit 98773c8

Please sign in to comment.