3.4 kernel bring-up

Search This thread

kabaldan

Inactive Recognized Developer
Dec 15, 2009
1,640
3,926
Prague
android.doshaska.net
By KitKat update for xt897/asanti being canceled, we're missing at least:
updated bootladers (sbl1,sbl2,sbl3 and appsboot), updated trustzone (not sure if that is an issue at this point), updated modem firmware.

Fortunately, at least the device tree for asanti seems to be ready and working fine, apart from not being handled by JB bootloader.

As a base, I'm using https://github.com/CyanogenMod/android_kernel_motorola_msm8960dt-common/tree/cm-11.0 that has been updated by dhacker for support of KitKat updated Razr HD/M.

To circumvent dt not being handled, I'm using appended dtb:
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y

Device tree partition check revealed that my device is p2 or p2b revision (https://github.com/MotorolaMobility...razrm/arch/arm/boot/dts/msm8960-asanti-p2.dts and https://github.com/MotorolaMobility...azrm/arch/arm/boot/dts/msm8960-asanti-p2b.dts are identical), so I'm using msm8960-asanti-p2.dtb appended to zImage.

Next issue is that bootloader is supposed to add dynamic data on runtime in addition to static ones loaded from dtb.

To get the display working, I've added:
Code:
	chosen {
		/* mipi_mot_cmd_auo_qhd_430 */
		mmi,panel_name = [6d6970695f6d6f745f636d645f61756f5f7168645f34333000];
	};
to msm8960-asanti-p2.dts.

That's where I'm currently. The next step is to add additional entries we're missing there (e.g. "mmi,mbmprotocol" etc.).

Regarding bootloaders, I see another issue - memory configuration.
There's failing shared mem allocation in mmi_unit_info_init:
https://github.com/CyanogenMod/andr...ob/cm-11.0/arch/arm/mach-msm/board-mmi.c#L433
That memory block is supposed to be reserved by sbl3, as indicated by https://github.com/MotorolaMobilityLLC/kernel-msm/commit/585b70b3fcd1af84edcb8748d1fdf190b32784af

Also, this commit https://github.com/MotorolaMobilityLLC/kernel-msm/commit/e3b9a040ca408d217a873df7994b9452ece04d16 indicates that Moto has done some tests also with older modem firmware, at least at some point...
 
Last edited:

skeevydude

Inactive Recognized Contributor
Feb 10, 2012
3,072
3,042
39
Hot Springs
If you need any logs or whatever from something not a Q, hit me up. Maybe something from my Atrix HD will help you out, I dunno -- AHD is stuck with JB until Q3 this year, so we're interested in this too.
 

mrvek

Senior Member
Feb 10, 2011
579
460
/home
Just 2 questions:

1) that moto test for older modem firmware with newer kernels, patch for asanti device tree (in which they state that device mostly works) might indicate that moto actually has updated bootloaders, etc, which we will never see?
2) this thread in development section is best left for dev disscusson? Ie, no potentially irritating stupid suggestions/questions/ideas/thoughts? (I have to ask)
 

fatihx

Member
Dec 2, 2009
43
3
Just 2 questions:

1) that moto test for older modem firmware with newer kernels, patch for asanti device tree (in which they state that device mostly works) might indicate that moto actually has updated bootloaders, etc, which we will never see?
2) this thread in development section is best left for dev disscusson? Ie, no potentially irritating stupid suggestions/questions/ideas/thoughts? (I have to ask)

http://xdaforums.com/showthread.php?t=2778330
 

kabaldan

Inactive Recognized Developer
Dec 15, 2009
1,640
3,926
Prague
android.doshaska.net
Just 2 questions:

1) that moto test for older modem firmware with newer kernels, patch for asanti device tree (in which they state that device mostly works) might indicate that moto actually has updated bootloaders, etc, which we will never see?
2) this thread in development section is best left for dev disscusson? Ie, no potentially irritating stupid suggestions/questions/ideas/thoughts? (I have to ask)

1 - yes, I'm pretty sure that test builds for asanti exist somewhere in moto labs from the time before 4.4 upgrade for Photon Q cancellation, with updated bootloader images and stuff, that we will unfortunately never see (I'm not very good in social hacking, so I don't expect myself to be able to get access to that internal stuff).

I also noticed this commit - https://github.com/MotorolaMobilityLLC/kernel-msm/commit/14e5887c3db194ec1a8aa6145910f7c7b64f95dc - they did not have enough asanti p2 hw revision devices for testing, so they needed some fixes to be able to test on an older p1 revision of the hardware...

VijayKumar Gn surely wasted some of his time on 4.4 bring-up for asanti before it got cancelled...

2 - It depends on the level of stupidity :) Even some very bright ideas may appear stupid at first sight, but can get proved to be great in the end.

At this point, I'm still not able get the BP going, it goes to crash and restart loop as soon as it's brought out of reset by the PIL (peripheral image loader).

I've pushed the kernel commits I use so far here in cm-11.0-3.4kJBbl branch:
https://github.com/nadlabak/android_kernel_motorola_msm8960dt-common/commits/cm-11.0-3.4kJBbl

It should go with something like this kernel setting in BoardConfig.mk:
Code:
# Inline kernel building
TARGET_KERNEL_SOURCE := kernel/motorola/msm8960dt-common
TARGET_KERNEL_CONFIG := msm8960_mmi_defconfig
TARGET_KERNEL_VARIANT_CONFIG := msm8960_mmi_xt897_defconfig
TARGET_KERNEL_SELINUX_CONFIG := msm8960_mmi_selinux_defconfig
BOARD_KERNEL_IMAGE_NAME := zImage-dtb
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 vmalloc=400M androidboot.write_protect=0 zcache androidboot.selinux=permissive androidboot.modelno=XT897 product=asanti_c androidboot.device=asanti_c androidboot.secure_hardware=1
BOARD_KERNEL_BASE := 0x80200000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02200000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 12884901888
 
Last edited:
  • Like
Reactions: huatz84 and mrvek

kabaldan

Inactive Recognized Developer
Dec 15, 2009
1,640
3,926
Prague
android.doshaska.net
OK, good news, I've got the BP running fine now, under 3.4 kernel.
 

Attachments

  • Screenshot_2014-06-23-10-21-47.png
    Screenshot_2014-06-23-10-21-47.png
    97.6 KB · Views: 1,068

Loader009

Senior Member
Jul 6, 2012
716
198
Just a little off-topic:
Do we have some indicators to differentiate between p1 and p2 devices?
 

kabaldan

Inactive Recognized Developer
Dec 15, 2009
1,640
3,926
Prague
android.doshaska.net
Just a little off-topic:
Do we have some indicators to differentiate between p1 and p2 devices?

You can check e.g. /proc/device-tree/System@0/EMUDetection@0 on your device.
If it contains Gpio-dmb-ppd@0, your device is P2.
If Gpio-dmb-ppd@0 is missing, but Gpio-id-en@0 and Gpio-id@0 are there, your device is P1.

It would be useful for me to know if there's actually a P1 device running CM11 out there somewhere.
 
Last edited:

Loader009

Senior Member
Jul 6, 2012
716
198
Ok, P2 also here.

Is it possible that P1 devices are prototypes?
Someone here had a prototype, I wouldn't wonder if it was a P1 device.
 

JoseBerga

Senior Member
Sep 26, 2011
237
102
Formosa
@kabaldan this would work also with xt925 with JB bl.. Because Motorola will not release kk for us until Q3 :(

If you need logs or something for xt925 count with me..

Sent from my RAZR HD using Forum Fiend v1.2.8.
 

CornholioGSM

Senior Member
Apr 13, 2005
773
306
Prague
You can check e.g. /proc/device-tree/System@0/EMUDetection@0 on your device.
If it contains Gpio-dmb-ppd@0, your device is P2.
If Gpio-dmb-ppd@0 is missing, but Gpio-id-en@0 and Gpio-id@0 are there, your device is P1.

It would be useful for me to know if there's actually a P1 device running CM11 out there somewhere.

...my photon is one of first and it is P2
 

kabaldan

Inactive Recognized Developer
Dec 15, 2009
1,640
3,926
Prague
android.doshaska.net
@stargo , @Skrilax_CZ , @mrvek , @arrrghhh and others:
Sorry for the delay. I've been too busy at work and home again (surprise!).

Anyway, I've finally managed to push my current local mess to razrqcom, reusing the old xt897 and msm8960-common repos for tentative 3.4 kernel on JB firmware builds.
Local manifest:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="razrqcom-dev-team/android_device_motorola_xt897" path="device/motorola/xt897" remote="github" revision="cm-11.0-3.4" />
  <project name="razrqcom-dev-team/android_device_motorola_msm8960-common" path="device/motorola/msm8960-common" remote="github" revision="cm-11.0-3.4" />
  <project name="razrqcom-dev-team/proprietary_vendor_motorola" path="vendor/motorola" remote="github" revision="cm-11.0-3.4" />
</manifest>

The main issues remain the same:
- while the modem subsystem can occasionally work stable for tens of minutes, it can also get being restarted by watchdog bite in matter of minutes or even seconds (=too often).
- occasional kernel panic (NULL pointer dereference) at process_one_work coming immediately after hitting this warning https://github.com/CyanogenMod/andr...t-common/blob/cm-11.0/kernel/workqueue.c#L550
 
Last edited:

Skrilax_CZ

Inactive Recognized Developer
Dec 20, 2009
1,240
2,398
No worries, I'm extremely busy lately too with practically no time for this stuff. I'm in China atm. And it's very hot in here (real feel: 44° C).
 
  • Like
Reactions: St.Noigel

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    @stargo , @Skrilax_CZ , @mrvek , @arrrghhh and others:
    Sorry for the delay. I've been too busy at work and home again (surprise!).

    Anyway, I've finally managed to push my current local mess to razrqcom, reusing the old xt897 and msm8960-common repos for tentative 3.4 kernel on JB firmware builds.
    Local manifest:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest>
      <project name="razrqcom-dev-team/android_device_motorola_xt897" path="device/motorola/xt897" remote="github" revision="cm-11.0-3.4" />
      <project name="razrqcom-dev-team/android_device_motorola_msm8960-common" path="device/motorola/msm8960-common" remote="github" revision="cm-11.0-3.4" />
      <project name="razrqcom-dev-team/proprietary_vendor_motorola" path="vendor/motorola" remote="github" revision="cm-11.0-3.4" />
    </manifest>

    The main issues remain the same:
    - while the modem subsystem can occasionally work stable for tens of minutes, it can also get being restarted by watchdog bite in matter of minutes or even seconds (=too often).
    - occasional kernel panic (NULL pointer dereference) at process_one_work coming immediately after hitting this warning https://github.com/CyanogenMod/andr...t-common/blob/cm-11.0/kernel/workqueue.c#L550
    9
    By KitKat update for xt897/asanti being canceled, we're missing at least:
    updated bootladers (sbl1,sbl2,sbl3 and appsboot), updated trustzone (not sure if that is an issue at this point), updated modem firmware.

    Fortunately, at least the device tree for asanti seems to be ready and working fine, apart from not being handled by JB bootloader.

    As a base, I'm using https://github.com/CyanogenMod/android_kernel_motorola_msm8960dt-common/tree/cm-11.0 that has been updated by dhacker for support of KitKat updated Razr HD/M.

    To circumvent dt not being handled, I'm using appended dtb:
    CONFIG_ARM_APPENDED_DTB=y
    CONFIG_ARM_ATAG_DTB_COMPAT=y

    Device tree partition check revealed that my device is p2 or p2b revision (https://github.com/MotorolaMobility...razrm/arch/arm/boot/dts/msm8960-asanti-p2.dts and https://github.com/MotorolaMobility...azrm/arch/arm/boot/dts/msm8960-asanti-p2b.dts are identical), so I'm using msm8960-asanti-p2.dtb appended to zImage.

    Next issue is that bootloader is supposed to add dynamic data on runtime in addition to static ones loaded from dtb.

    To get the display working, I've added:
    Code:
    	chosen {
    		/* mipi_mot_cmd_auo_qhd_430 */
    		mmi,panel_name = [6d6970695f6d6f745f636d645f61756f5f7168645f34333000];
    	};
    to msm8960-asanti-p2.dts.

    That's where I'm currently. The next step is to add additional entries we're missing there (e.g. "mmi,mbmprotocol" etc.).

    Regarding bootloaders, I see another issue - memory configuration.
    There's failing shared mem allocation in mmi_unit_info_init:
    https://github.com/CyanogenMod/andr...ob/cm-11.0/arch/arm/mach-msm/board-mmi.c#L433
    That memory block is supposed to be reserved by sbl3, as indicated by https://github.com/MotorolaMobilityLLC/kernel-msm/commit/585b70b3fcd1af84edcb8748d1fdf190b32784af

    Also, this commit https://github.com/MotorolaMobilityLLC/kernel-msm/commit/e3b9a040ca408d217a873df7994b9452ece04d16 indicates that Moto has done some tests also with older modem firmware, at least at some point...
    9
    OK, good news, I've got the BP running fine now, under 3.4 kernel.
    9
    Just to give a 3.4 kernel on Q current status report:
    It's not stable yet. Occasionally, there's a kernel panic, usually when going to suspend state.
    Will need to figure out the cause.
    Otherwise, everything is basically working: radio, gps, nfc, wlan (while using the new wcnss firmware), bt, audio, camera, usb...
    6
    Hi,

    Thanks @kabaldan for your work :)

    The main issues remain the same:
    - while the modem subsystem can occasionally work stable for tens of minutes, it can also get being restarted by watchdog bite in matter of minutes or even seconds (=too often).
    - occasional kernel panic (NULL pointer dereference) at process_one_work coming immediately after hitting this warning https://github.com/CyanogenMod/andr...t-common/blob/cm-11.0/kernel/workqueue.c#L550

    I think these two issues are connected, the kernel-panic happens when the kernel tries to notify other parts of the system about state-changes and the corresponding list got corrupted by the crashing modem.

    Just to write down what I found out on the weekend:

    1. The crash mostly occurs when one of the CPU-cores changes power-state, usually 2 seconds after CPU1 is shut down
    2. Quite often there are IPC messages to the modem in the time between the CPU-shutdown and the modem-crash
    3. Sometimes the modem crashes without any event when the system was idle for 20s or more.

    Sample log for point 1&2:
    Code:
    <6>[   52.114512,0] CPU1: shutdown
    <6>[   53.010834,0] [HDR] [w rr_h] ver=1,type=data    ,src_nid=00000001,src_port_id=0000001a,control_flag=0,size= 25,dst_pid=00000000,dst_cid=00000007
    <6>[   53.011231,0] alarm_set_rtc: Failed to set RTC, time will be lost on reboot
    <6>[   53.115153,1] CPU1 is up
    <6>[   53.365603,0] [RAW] ver=1 type=1 src=0:00000007 crx=0 siz=14 dst=1:0000001a
    <6>[   53.499374,1] [HDR] [w rr_h] ver=1,type=data    ,src_nid=00000001,src_port_id=00000034,control_flag=0,size= 25,dst_pid=00000000,dst_cid=0000000c
    <3>[   54.555470,0] Watchdog bite received from modem software!
    <3>[   54.555562,0] modem subsystem failure reason: (unknown, smem_get_entry failed).
    (CPU1 doesn't have to get up again and the RTC error is usually the first time after a system-boot when the modem crashes, IPC dst 1:xxx is the modem)

    I have the feeling that the problem is not at all software related but we have a power-problem with the modem and it's crashing when the power-levels fluctuate and it has to do some work when that happens.

    Comparing the Asanti device-tree to the decompiled ghost one reveals major differences (mostly because ghost is based on msm8960ab). Ghost has some pm-regulators defined as always-on for example. I've attached the decompiled ghost-devtree and the decompiled old asanti-devtree (more or less useless, and has some byteorder-problems) to this post.
    I've also tried basing asanti on msm8960ab (which also missed the always-on parts), but this didn't help (but it did boot up correctly).

    Let's hope we find the problem soon :)

    Cheers,
    Michael