[AOSP-KERNEL] QCOM 3.4 Kernel Development [05/29: Faded TWRP Screen, crashing]

Search This thread

Hashcode

Senior Recognized Developer
Sep 3, 2011
3,424
23,730
Hi Guys,

I thought I would get a thread going on this as I'm moving along (rather slowly -- I'll admit) on developing a new kernel for the Motorola QCOM phones. Obviously I will be testing it against the RAZR-HD, but if done correctly it should support RAZR-M, Atrix-HD and Photon Q.

Why a new kernel?
  1. For full Android 4.2.x support we need to migrate to a fully redeveloped video system which include vsync, fencing and other major changes from the 3.0 kernel. We have tried to backport some of these changes with some success but in the meantime it's causing other side effects. Along with the video driver updates are camera subsystem and many many other updates.[/*]
  2. For the future of the device we want to stay as close to Nexus type devices so that we can compile AOSP out of the box so to speak. N4 (Mako) uses a 3.4 kernel based on the same exact branch that I'm using from Code Aurora Forums (CAF).[/*]

What sources am I using?

I've started on the CAF base branch "jb_2.5" used to bring up the Nexus 4 device:
https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=shortlog;h=refs/heads/jb_2.5


And the new kernel source is on github under a "razrqcom-dev-team" where Pinter and DHacker and others can all join in:
https://github.com/razrqcom-dev-team/android_kernel_motorola_msm8960-common/commits/cm-10.1-dev

[NOTE] I have NOT posted my local changes to that kernel yet. It's the CAF sources + 2-3 commits I cherry-picked in, currently.


Current Status:
  1. [DONE] Add all new drivers from the Motorola JB kernel posted on Sourceforge.net[/*]
  2. [DONE] Patch existing code with Motorola specific changes (in a minimal sort of way -- only what is absolutely required here)[/*]
  3. [DONE] Fix compile errors[/*]
  4. [4/22 DONE] Push initial moto changes to github (over 2 pages of changes grouped by driver/section)[/*]
  5. [IN-PROGRESS] Boot testing using a recovery. Have to get far enough to where I'm seeing a ram-console "last_kmsg".[/*]
  6. 1-by-1 debug each driver using last_kmsg to where we get a fully functioning recovery build. This includes using binaries like evtest to debug touchscreen events, and other sensors.[/*]
  7. Change over to a full Android build using CM sources which are fully patched up against CAF's latest sources: includes new hardware drivers for video, camera, audio and others.[/*]
  8. Debug the Android boot using strace and other binaries till it's solid enough to start using specific apps to play test and debug issues.[/*]
Once I get to a point where I can post a full dmesg, I'll add that to this post (for those that are curious).

Thanks for being patient.
 
Last edited:

Hashcode

Senior Recognized Developer
Sep 3, 2011
3,424
23,730
Current Bootlog:

http://pastebin.com/raw.php?i=JV9kxrKs

Lines of note in the log:

SMD driver noting lack of allocation table

<3>[ 0.601617,1] smd_channel_probe_worker: allocation table not initialized

Backlight needs work

<7>[ 0.813825,0] lcd-backlight: invalid backlight type

Not sure what this is

<3>[ 0.815412,0] cont_splash_clk_ctrl: dsi_esc_clk - clk_set_rate failed

Checking this

<3>[ 1.055608,0] wcd9xxx_slim_probe: failed to get slimbus tabla-slim logical address: -6

This SPI error happens on other 3.4 kernels I've seen. I think there's a patch for it

<6>[ 1.126659,1] spi_qsd spi_qsd.0: master is unqueued, this is deprecated

USB probe fail

<3>[ 1.165847,1] msm_hsusb msm_hsusb: udc_probe failed

and then the Android gadget fail after that

<3>[ 1.166641,1] android_probe: android_probe(): Failed to register android composite driver

Ext. SD card error

<3>[ 1.219594,0] mmc1: msmsdcc_slot_status: Failed to configure GPIO 171

Seeing some i2c errors for the gsbi4 device:

<4>[ 1.475263,0] qup_i2c qup_i2c.4: Bus still busy, status 132100

Sensor fail

<3>[ 2.614924,0] lm3556_init_registers: Reading 0x0 failed -110

Missing GPIO setup for headset detect

<3>[ 2.632260,1] msm8960_configure_headset_mic_gpios: US_EURO_, AV_SWITCH gpios not configured!!!

Bunch of failed audio init messages (I can't remember if I merged in audio changes)

<6>[ 2.632351,1] msm_audio_init: Not APQ8064 in SLIMBUS mode
<3>[ 2.632382,1] msm8930_audio_init: Not the right machine type
<3>[ 2.632382,1] msm_audio_init: Not the right machine type
<6>[ 2.632412,1] msm_audio_init: Not APQ8064 in I2S mode

BMS battery issues (probably linked to: <7>[ 28.167862,1] Trying to free already-free IRQ 567 through 562 messages)

<3>[ 28.167648,1] pm8xxx_batt_alarm_threshold_set: threshold value, 0 mV, is outside of allowable range: [2500, 5675] mV
<3>[ 28.167709,1] pm8921_bms_configure_batt_alarm: unable to set batt alarm threshold rc=-22
<3>[ 28.167739,1] pm8921_bms_probe: Couldn't configure battery alarm! rc=-22

<4>[ 28.174118,1] pm8921-bms: probe of pm8921-bms failed with error -22

<3>[ 28.177048,0] power_supply usb: driver failed to report `present' property: 4294967274
 
Last edited:

skinien

Senior Member
Aug 6, 2010
575
63
San Diego
Thanks for posting progress in such detail. It's cool to learn a bit about how you go about such a task. Thanks for your efforts!!

Sent from my DROID RAZR HD using xda app-developers app
 

PantsDownJedi

Senior Member
Oct 30, 2011
285
81
Not a developer but am a big fan of the possibility of improvements whether they be on stock or CM and reckoned I'd post to include my enthusiasm to hear that there's more and more people involved that know what their doing. If there's a lack of response to the thread please don't be discouraged; people have been overall frustrated to the point of giving up hope for their flashaholicism. There's exiting things happening in other threads as well and its good to see other developers interested here in this one.

Lets get some +1's in the thread!!! Some hits of the thanks button on the OP!!!
 

Xplorer4x4

Senior Member
Mar 12, 2010
1,039
323
OnePlus 9
How does one ascertain this skill to develop a kernel such as this? I would like to assist you but I lack the correct knowledge to establish any sort of help.

Sent from Cthulu's brain
Not to be smart but google it. You might be better off learning to do a kernel for a Linux disto then trying an android kernel. I could be wrong but in either case it is a skill that takes time. By the time you have enough knowledge to help, hash will probably have the first release out. Heck he may have several updates by that time.

Hashcode how is your progress is going

Sent from my MB886 using xda premium
Be patient. When there is an update hash will post.


Sent from my XT926 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 97
    Hi Guys,

    I thought I would get a thread going on this as I'm moving along (rather slowly -- I'll admit) on developing a new kernel for the Motorola QCOM phones. Obviously I will be testing it against the RAZR-HD, but if done correctly it should support RAZR-M, Atrix-HD and Photon Q.

    Why a new kernel?
    1. For full Android 4.2.x support we need to migrate to a fully redeveloped video system which include vsync, fencing and other major changes from the 3.0 kernel. We have tried to backport some of these changes with some success but in the meantime it's causing other side effects. Along with the video driver updates are camera subsystem and many many other updates.[/*]
    2. For the future of the device we want to stay as close to Nexus type devices so that we can compile AOSP out of the box so to speak. N4 (Mako) uses a 3.4 kernel based on the same exact branch that I'm using from Code Aurora Forums (CAF).[/*]

    What sources am I using?

    I've started on the CAF base branch "jb_2.5" used to bring up the Nexus 4 device:
    https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=shortlog;h=refs/heads/jb_2.5


    And the new kernel source is on github under a "razrqcom-dev-team" where Pinter and DHacker and others can all join in:
    https://github.com/razrqcom-dev-team/android_kernel_motorola_msm8960-common/commits/cm-10.1-dev

    [NOTE] I have NOT posted my local changes to that kernel yet. It's the CAF sources + 2-3 commits I cherry-picked in, currently.


    Current Status:
    1. [DONE] Add all new drivers from the Motorola JB kernel posted on Sourceforge.net[/*]
    2. [DONE] Patch existing code with Motorola specific changes (in a minimal sort of way -- only what is absolutely required here)[/*]
    3. [DONE] Fix compile errors[/*]
    4. [4/22 DONE] Push initial moto changes to github (over 2 pages of changes grouped by driver/section)[/*]
    5. [IN-PROGRESS] Boot testing using a recovery. Have to get far enough to where I'm seeing a ram-console "last_kmsg".[/*]
    6. 1-by-1 debug each driver using last_kmsg to where we get a fully functioning recovery build. This includes using binaries like evtest to debug touchscreen events, and other sensors.[/*]
    7. Change over to a full Android build using CM sources which are fully patched up against CAF's latest sources: includes new hardware drivers for video, camera, audio and others.[/*]
    8. Debug the Android boot using strace and other binaries till it's solid enough to start using specific apps to play test and debug issues.[/*]
    Once I get to a point where I can post a full dmesg, I'll add that to this post (for those that are curious).

    Thanks for being patient.
    22
    Woops, forgot to update here:

    New bootlog: http://pastebin.com/raw.php?i=JV9kxrKs

    And #2 post has a summary notable lines from the bootlog (stuff I'm working on).

    Boots up into TWRP for a few seconds and I can play w/ the touch screen, but then it crashes out.

    Mainly I'm trying to bring up USB which is made complicated by the EMU-Detection driver Motorola has in their kernel. Handles things like dock modes, otg, debug accessories, etc.
    20
    Got my initial Motorola changes for 3.4 updated to github:

    https://github.com/razrqcom-dev-team/android_kernel_motorola_msm8960-common/commits/cm-10.1-dev

    Took a while, now back to debugging the initial boot sequence.
    14
    Amazing job Hashcode. Count me in.
    6
    Current Bootlog:

    http://pastebin.com/raw.php?i=JV9kxrKs

    Lines of note in the log:

    SMD driver noting lack of allocation table

    <3>[ 0.601617,1] smd_channel_probe_worker: allocation table not initialized

    Backlight needs work

    <7>[ 0.813825,0] lcd-backlight: invalid backlight type

    Not sure what this is

    <3>[ 0.815412,0] cont_splash_clk_ctrl: dsi_esc_clk - clk_set_rate failed

    Checking this

    <3>[ 1.055608,0] wcd9xxx_slim_probe: failed to get slimbus tabla-slim logical address: -6

    This SPI error happens on other 3.4 kernels I've seen. I think there's a patch for it

    <6>[ 1.126659,1] spi_qsd spi_qsd.0: master is unqueued, this is deprecated

    USB probe fail

    <3>[ 1.165847,1] msm_hsusb msm_hsusb: udc_probe failed

    and then the Android gadget fail after that

    <3>[ 1.166641,1] android_probe: android_probe(): Failed to register android composite driver

    Ext. SD card error

    <3>[ 1.219594,0] mmc1: msmsdcc_slot_status: Failed to configure GPIO 171

    Seeing some i2c errors for the gsbi4 device:

    <4>[ 1.475263,0] qup_i2c qup_i2c.4: Bus still busy, status 132100

    Sensor fail

    <3>[ 2.614924,0] lm3556_init_registers: Reading 0x0 failed -110

    Missing GPIO setup for headset detect

    <3>[ 2.632260,1] msm8960_configure_headset_mic_gpios: US_EURO_, AV_SWITCH gpios not configured!!!

    Bunch of failed audio init messages (I can't remember if I merged in audio changes)

    <6>[ 2.632351,1] msm_audio_init: Not APQ8064 in SLIMBUS mode
    <3>[ 2.632382,1] msm8930_audio_init: Not the right machine type
    <3>[ 2.632382,1] msm_audio_init: Not the right machine type
    <6>[ 2.632412,1] msm_audio_init: Not APQ8064 in I2S mode

    BMS battery issues (probably linked to: <7>[ 28.167862,1] Trying to free already-free IRQ 567 through 562 messages)

    <3>[ 28.167648,1] pm8xxx_batt_alarm_threshold_set: threshold value, 0 mV, is outside of allowable range: [2500, 5675] mV
    <3>[ 28.167709,1] pm8921_bms_configure_batt_alarm: unable to set batt alarm threshold rc=-22
    <3>[ 28.167739,1] pm8921_bms_probe: Couldn't configure battery alarm! rc=-22

    <4>[ 28.174118,1] pm8921-bms: probe of pm8921-bms failed with error -22

    <3>[ 28.177048,0] power_supply usb: driver failed to report `present' property: 4294967274