12/29/2012

How to remove internal mass storage on QRD Android (ICS)

1. remove the "UDISK" partition from the partition table, and correspondingly enlarge the size of Userdata partition:
modem_proc\core\storage\tools\jsdcc\partition_load_pt\partiton.xml
Then regenerate rawprogram0.xml and patch0.xml

2. set the new size for BOARD_USERDATAIMAGE_PARTITION_SIZE in file /device/qcom/msm7626a/boardconfig.mk

3. change persist.sys.emmcpartition property to 0 in the file /device/qcom/msm7627a/system.prop

persist.sys.emmcpartition=0

and make sure persist.sys.emmcsdcard.enabled is disabled(0)

4. remove the USB lun item in file kernel/drivers/usb/gadget/android.c:
function 'mass_storage_function_init':

<...>
#if 0 // modified this line, remove internal stroage.
config->fsg.luns[0].cdrom = 0; // sdcard
config->fsg.luns[1].cdrom = 0; // internal storage
config->fsg.luns[2].cdrom = 1; // cdrom
#else
config->fsg.luns[0].cdrom = 0; // sdcard
config->fsg.luns[1].cdrom = 1; // cdrom

12/20/2012

How to download modem image via fastboot with QRD8x25 platform

Note: it is only for emmc boot.
1.change mbr_fill_name() in the $(AP_CODE)/bootable/bootloader/lk/platform/msm_shared/partition_parser.c
(1).change "memcpy(partition_ent->name, "sbl1", 4);" to "memcpy(partition_ent->name, "qcsblhd_cfgdata", 15);"
(2).change "memcpy(partition_ent->name, "sbl3", 4);" to
"memcpy(partition_ent->name, "qcsbl", 5);"
(3).change "memcpy(partition_ent->name, "rpm", 3);" to
"memcpy(partition_ent->name, "emmc_appsboot", 13);"
(4).change "memcpy(partition_ent->name, "tz", 2);" to "memcpy(partition_ent->name, "oemsbl", 6);"
(5).delete all the functions when the type is "MBR_MODEM_TYPE" or MBR_MODEM_TYPE2, and execute "memcpy(partition_ent->name, "fat", 3);" when the type is "MBR_MODEM_TYPE" or "MBR_MODEM_TYPE" .

2.re-build emmc_appsboot*.mbn and download them into the phone;

3.generate oemsbl.bin and emmc_appsboot.bin
the struct of the oemsbl.bin is
(oemsblhd.mbn + some 0x00) + oemsbl.mbn
|<----------512byte-------->|
the struct of the emmc_appsboot.bin is
(emmc_appsboothd.mbn + some 0x00) + emmc_appsboot.mbn
|<-------------512byte----------->|
you can download the pre-fastboot tool to generate these images.

chick here to download pre-fastboot:
https://docs.google.com/open?id=0B8FEzcDZzbOFZGRtOS1ZMmhPSm8

4.Then you can test to use the following command to download images in the fastboot mode:
fastboot flash qcsblhd_cfgdata qcsblhd_cfgdata.mbn
fastboot flash qcsbl qcsbl.mbn
fastboot flash oemsbl oemsb.bin
fastboot flash fat fat.bin
fastboot flash emmc_appsboot emmc_appsboot.bin

12/19/2012

How to build adb.exe/fastboot.exe on Ubuntu

1.apt-get install mingw32
2. build/envsetup.sh
3.choosecombo. config your settings
4.make USE_MINGW=y adb
make USE_MINGW=y fastboot
5.check out/host/windows-x86/bin for adb.exe/fastboot.exe

How to build AMSS with windows for QRD8x25

If you compile in windows xp, please use a clean PC , please reference build/ms/rvct22.bat for installing path.

1. install cygwin 1.7 (important remove the python contain in cygwin) ,choose "install all".

2. install python 2.6.6.msi for windows

3. install actvie perl 5.8.8

4. install the RVDS 2.2 with patch593,after setup, cd C:\apps\rvds221\RVCT\Programs\2.2\593\win_32-pentium,and execute

cp armcc tcc
cp armcc armcpp
cp armcc tcpp

To check the versions, run armcc --vsn. It should return the following:
ARM/Thumb C/C++ Compiler, RVCT2.2 [Build 593]
Software supplied by: ARM Limited

armcpp --vsn
tcc --vsn
tcpp --vsn
armlink --vsn
armasm --vsn
fromelf --vsn
The version returned should be build 593 for all.

5. modify the windows environment variable path " add cygwin path and python path

6. modify the rvct22.bat in build/ms

7. modify build command such as SSKOLY_FLASH_*.cmd, set $0 to %0, set BUILD_UNIX=no

8. in cmd windows, execute the rvct22.bat next ,execute theSSKOLY_FLASH_*.cmd

There may be some error, please see
http://www.anyclub.org/2012/11/some-error-when-build-qrd8225-modem.html

12/18/2012

enable uart debug in lk on QRD8x25

uart1 is default to use for debug

1.Set uart
bootable/bootloader/lk/platform/msm_shared/uart.c
static unsigned uart_base = MSM_UART1_BASE;

2.Set WITH_DEBUG_UART
bootable\bootloader\lk\project\msm7627a.mk
DEFINES += WITH_DEBUG_UART=1

3.Set debug level
Bootable/bootloader/lk/include/Debug.h
#define DEBUGLEVEL 2

Daisy-chain on primary JTAG, USB Trace32 with QRD8X25

Please make sure the jtag hardware connection is right. mode=0001(ARM9+CORTEX) ,ps_hold=1
In the software To use a primary and auxiliary JTAG configuration and a USB connection to the debugger, perform the following steps.
1. Copy the following files from the release modem_proc\tools\T32 directory to C:\T32.
config-chain-cortex-usb.t32
config-chain-arm9-usb.t32
startup-chain-cortex.cmm
startup-chain-arm9.cmm
2. Create a shortcut to start the ARM9 Trace32 session with the following properties.
Name: Trace32 ARM9
Target: C:\T32\t32marm.exe -c config-chain-arm9-usb.t32, startup-chain-arm9.cmm
Start in: C:\T32
3. Create a shortcut to start the ARM11 Trace32 session with the following properties.
Name: Trace32 CORTEX
Target: C:\T32\t32marm.exe -c config-chain-cortex-usb.t32, startup-chain-cortex.cmm
Start in: C:\T32
4. Start the ARM9 Trace32 session by opening the Trace32 ARM9 shortcut. Then start the CORTEX session by opening the Trace32 CORTEX shortcut.


the jload.cmm can be used in daisy-chain mode.
2. open the ARM9 & CORTEX application at the same time.
3. in the ARM9 window, do jload.cmm, the select the elf and vmlinuz
4. in the CORTEX window, when the CORTEX was bring up, break it.
5. do sync in the ARM9
6. d.load *.elf /nocode /noclear and select the vmlinuz
7. set a breadpoint at CORTEX
8. do sync in the ARM9
9. GO in the CORTEX window.
if the breadpoint is available , the pragram will break at the point.

12/17/2012

How to diable dual-sim card function on QRD8225

1.adb shell setprop persist.dsds.enabled false
2.Set NV04398 -> 1
3.Set NV6907 -> 0
4.Set NV6876 -> 0 0 0 0 0x01

11/29/2012

Force emergency download feature on QRD 8x25 release

This solution is only compatible with these releases:
R8625SSNSKQLYM10040400 and later

QRD implement a new feature to force phone to enter emergency download mode at boot up stage. It depends on the status of gpio40. If gpio40 is low, the phone will be force enter emergency download mode. For normal boot up, gpio40 should be default high.

This feature is default ON. Please pay attention to the gpio40 connection in your HW design to avoid boot up failure.

To disable this feature in SW, please delete related code in modem_proc\core\boot\secboot\cfg_data\7627\clock\clock.cfg.

gpio_40_to_emprg{
GPIO_IN1, 0x01000000,
READ_REGISTER, 0x01000000, /*because gpio40 default is high*/
BRANCH_ON_READ_FAIL, 2, /*so in normal boot, always sucess, if force dload mode, need pull down gpio40*/
BRANCH_ALWAYS, 2, /*normal boot will skip the fowllow line*/
WRITE_32_BIT, 0xfffef800, /*write to a invalid address will go into edload */
} /*delete this segment*/

K{
%tag description Clock: 48Mhz%
%tag BUS_SPEED 48%

%include gpio_40_to_emprg% /*delete this line*/
%include configure_48MHZ%
}

Then clean and rebuild all.

11/15/2012

Some error when build QRD8225 modem with windows

the released version is HY11-NA094-7_1.0.145451
build id is SSKOLYM_FLASH_H9DP32A4JJACGR_KEM (USE_UNIX=no)
buid entironment: Windows+cygwin
GNU make 3.81
RVCT2.2 build 593
perl 5.8.8
python 2.6.2
those entironment can build 7x30 platform
the fat.bin and udisk.bin has not been generated , the build error is following



LINKING cpfatfs.exe
gcc -mno-cygwin -o cpfatfs.exe cpfatfs.o
-----------------------------------------------------------
make[1]: Leaving directory `/e/build/W840A/_CodeBase/HY11-NA094-7_1.0.145451/modem_proc/core/storage/tools/fattool'
===============================================================
---------------------------------------------------------------
Generating fat.bin for eMMC.

SSNSKOLY
../../core/storage/tools/fattool/cpfatfs.exe ../../build/ms/bin/SSNSKOLY/fat.bin image ../../build/ms/bin/SSNSKOLY/amss
hd.mbn
Found directory: change working directory to: 1b1.
Incoming file size: 2293256
Adding file to cluster 3.
Insufficient disk space to copy data file.
make: *** [genfatfs] Error 1
rm ../../core/boot/secboot/cfg_data/boot_cfg_data.exe bin/SSNSKOLY/emmcbld/emmcbld.mbn bin/SSNSKOLY/emmcbld/emmcbldhd.mb
n ../../core/boot/secboot/qcsbl/qcsblhd.mbn


I think the fat.bin image is generated by cpfatfs.exe from amsshd.mbn and amss.mbn
there must be some problem to build modem_proc\core\storage\tools\fattool

so modify modem_proc\core\storage\tools\fattool\Makefile to set BUILD_UNIX=y, it will be OK.

9/18/2012

How to change CPU Dynamic Frequency Scaling

Using the Sys Interface

The files in /sys/devices/system/cpu/cpu0/cpufreq/ provide information and a means of controlling the frequency scaling subsystem. Seed values are given in Khz. You need to be root to access the /sys filesystem.
Your max speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq.
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
700000
Your min speed is at /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq.
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
500000
If you are using the userspace governor, you can write to /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change the current speed.
# echo 700000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo
cpu MHz : 697.252
# echo 900000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
# cat /proc/cpuinfo
cpu MHz : 976.152



Using Frequency Scaling Governors

You can get a list of available governors with (as root):
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative ondemand powersave userspace performance
Note: If the governors are compiled as modules, load them first:
# modprobe cpufreq_performance cpufreq_ondemand cpufreq_conservative cpufreq_powersave cpufreq_userspace
Now we set our governor: What is our current governor?
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
userspace
Set new governor and watch if it has changed
# echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
conservative
Congrats! Your governor is active.
You may set the governor in your init.rc, to make it used on every boot.