Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,752 Members 39,709 Now Online
XDA Developers Android and Mobile Development Forum

[DEV-Only] 3.x Kernel for Xperia X10

Tip us?
 
Tof37
Old
#1  
Tof37's Avatar
Senior Member - OP
Thanks Meter 2,610
Posts: 607
Join Date: Oct 2009
Location: Tours

 
DONATE TO ME
Default [DEV-Only] 3.x Kernel for Xperia X10

As some may know, I'm getting headaches since months (I'm not a professional dev ...) to port 3.0.8 kernel on x10.

I'm opening a new thread to talk about progress on 3.x kernel ported to the
ES209RA..

I'd like to share the work I've made since last year and involve as much people as it's possible.

I'll try to keep this thread updated with "what is working" and a "to do" or "to fix list" ...

You've been warned : this a development thread, and until kernel is "officialy" relased, flashing stuff or adding changes in kernel and flashing it on your device without knowing what you do may damage your phone.

Important notice :

This is not a thread to teach "how to port" or else ...

However when the time will come, testers will be needed, posts will be make to have report etc ...

Don't ask for ETA ...

Thanks a lot for understanding
If you like my work, and want to help me click here to donate

Semc Debrand Engine Contributor

Member of Team XSonX10
---------------------------------------------------------
My contributions on XDA

Achotjan's remplacement Stock- Light Version

X10s Rom

Fast java sources decompiler
The Following 38 Users Say Thank You to Tof37 For This Useful Post: [ Click to Expand ]
 
Tof37
Old
(Last edited by Tof37; 2nd February 2014 at 08:07 PM.)
#2  
Tof37's Avatar
Senior Member - OP
Thanks Meter 2,610
Posts: 607
Join Date: Oct 2009
Location: Tours

 
DONATE TO ME
Kernel 3.0.8 porting

Ported on X10 from msm7x30-3.0.x-nAa

Thanks to :

nAa for his sources and his thread to get serial console,
Fxp, Doomlord, Androxyde for there answer to my annoying questions about serial console ,
Achotjan, Feravolt, Scritch and all other who helped me a lot since I started this project.

The link to my repo : Tof37-Github

For now this kernel is just made to be used as a base.

What is working :
  • Kernel is built with almost all ES209RA drivers (I think ar6000 are missing, nothing else)
  • it boots
  • Display is (finally) working
  • Rom (tested with an old CM9) is booting. Also booting on CM10.1 and 4.2.2 aosp (strange display problem with aosp)
  • ADB is working (dmesg and logcat can be done)
  • Battery chatging is working, data and led color are ok too
  • Got rom display. (Cm10.1 maybe others) ... for a stock configuration it's not so bad ...


Bug list :
  • QDSP6 has to be disabled, smsm modem is reseting
  • Recovery key access mismatch (it works only when it wants ...)
  • Added needed files and lines in defconfig to build ar6000.ko.
    Have to port some codes in msm_sdcc.c for plat_disable_wlan_slot and plat_enable_wlan_slot ... seems to be needed to turn wifi on and off ...
  • Added lines in defconfig to enable bluetooth ... still not working
  • maybe more I don't even know ...

To do:
  • Fix known bugs
  • Had necessary changes in ramdisk
If you like my work, and want to help me click here to donate

Semc Debrand Engine Contributor

Member of Team XSonX10
---------------------------------------------------------
My contributions on XDA

Achotjan's remplacement Stock- Light Version

X10s Rom

Fast java sources decompiler
The Following 29 Users Say Thank You to Tof37 For This Useful Post: [ Click to Expand ]
 
Tof37
Old
(Last edited by Tof37; 13th January 2014 at 12:14 PM.)
#3  
Tof37's Avatar
Senior Member - OP
Thanks Meter 2,610
Posts: 607
Join Date: Oct 2009
Location: Tours

 
DONATE TO ME
Kernel 3.4.0

WIP ... don't fully build
If you like my work, and want to help me click here to donate

Semc Debrand Engine Contributor

Member of Team XSonX10
---------------------------------------------------------
My contributions on XDA

Achotjan's remplacement Stock- Light Version

X10s Rom

Fast java sources decompiler
The Following 18 Users Say Thank You to Tof37 For This Useful Post: [ Click to Expand ]
 
FeraVolt
Old
#4  
FeraVolt's Avatar
Senior Member
Thanks Meter 13,022
Posts: 1,752
Join Date: Dec 2011

 
DONATE TO ME
Thanks Nice work
The Following 9 Users Say Thank You to FeraVolt For This Useful Post: [ Click to Expand ]
 
Achotjan
Old
#5  
Achotjan's Avatar
Senior Member
Thanks Meter 11,436
Posts: 2,031
Join Date: Apr 2010
Location: Marseille

 
DONATE TO ME
reserved :

thanks tof you are definitly change the future ofxperia x10

cheers

Achotjan
Achot Asrian (Achotjan)
------------------------------------------------
www.XperiaOverlay.com


Xperia Overlay

The Following 12 Users Say Thank You to Achotjan For This Useful Post: [ Click to Expand ]
 
SeC0nduNiT
Old
#6  
SeC0nduNiT's Avatar
Member
Thanks Meter 29
Posts: 38
Join Date: Sep 2009
i'm ready for testing
Timeo Danaos et Dona Ferentes / N0 SystEm iS sAVE... / Proud X10i user /

X10i Black
Kernel: FeraKernel-GB-v24 (2.3.9)
ROM: FeraLab v39
ULBL&Baseband: .71 & Card 8GB Class 2
Min: 245 Max: 1,119 SmartAssH3 sio
The Following User Says Thank You to SeC0nduNiT For This Useful Post: [ Click to Expand ]
 
Tof37
Old
#7  
Tof37's Avatar
Senior Member - OP
Thanks Meter 2,610
Posts: 607
Join Date: Oct 2009
Location: Tours

 
DONATE TO ME
Default Log for qdsp crash

Here is the log I got with qdsp6 enabled :
PHP Code:
[   12.548407] ------------[ cut here ]------------                                                                       
[   
12.548533WARNINGat drivers/gpio/gpiolib.c:101 gpio_ensure_requested+0x4c/0xfc()                                   
[   
12.548695autorequest GPIO-149                                                                                       
[   12.548766Modules linked in:                                                                                         
[   
12.548864] [<c0047010>] (unwind_backtrace+0x0/0xf0from [<c0089af4>] (warn_slowpath_common+0x4c/0x64)                
[   
12.549893] [<c0089af4>] (warn_slowpath_common+0x4c/0x64from [<c0089b8c>] (warn_slowpath_fmt+0x2c/0x3c)              
[   
12.559441] [<c0089b8c>] (warn_slowpath_fmt+0x2c/0x3cfrom [<c0270708>] (gpio_ensure_requested+0x4c/0xfc)             
[   
12.569079] [<c0270708>] (gpio_ensure_requested+0x4c/0xfcfrom [<c0270928>] (gpio_direction_output+0x74/0x158)        
[   
12.579157] [<c0270928>] (gpio_direction_output+0x74/0x158from [<c00728ec>] (analog_init+0x18/0x28)                  
[   
12.588348] [<c00728ec>] (analog_init+0x18/0x28from [<c0070e40>] (q6audio_init+0x214/0x2e4)                          
[   
12.596855] [<c0070e40>] (q6audio_init+0x214/0x2e4from [<c0072490>] (q6audio_open_pcm+0x20/0x200)                    
[   
12.605883] [<c0072490>] (q6audio_open_pcm+0x20/0x200from [<c0072b8c>] (pcm_ioctl+0x1d0/0x3f4)                       
[   
12.614658] [<c0072b8c>] (pcm_ioctl+0x1d0/0x3f4from [<c01153a8>] (do_vfs_ioctl+0x508/0x584)                          
[   
12.623158] [<c01153a8>] (do_vfs_ioctl+0x508/0x584from [<c0115458>] (sys_ioctl+0x34/0x54)       MODEM/AMSS has CRASHED                      
[   12.631502] [<c0115458>] (sys_ioctl+0x34/0x54from [<c0042480>] (ret_fast_syscall+0x0/0x30)                           
[   
12.639903] ---[ end trace 47a718f49542dde2 ]---                                                                       
[   
12.690778]                                                                                                            
[   
12.690789SMSMModem SMSM state changed to SMSM_RESET.                                                              
[   
12.691454Notifystart reset                                                                                        
[   14.336724]                                                                                     
[   
14.337405smemCRASH LOG                                                                                            
[   14.337410'ERR crash log report.  Version 2. 
In analog_audio.c adding (like KTG .32 kernel)
PHP Code:
gpio_request(GPIO_HEADSET_AMPNULL
solved the warning ...but not the crash still having :

PHP Code:
[   17.020205] [pcm_out.c:pcm_openopen
<6>[   17.020852] [q6audio.c:q6audio_initcodecs
<6>[   17.021094] [q6audio.c:q6audio_initattach ADSP
<6>[   17.128602] [dal.c:dal_attachstatus 0name 'DAL_AQ_AUD' dal_client d5c24000
<6>[   17.128795] [q6audio.c:q6audio_initINIT
<6>[   17.130021] [q6audio.c:q6audio_initOPEN control
<6>[   17.540540] [q6audio.c:q6audio_initattach ACDB
<6>[   17.644275] [dal.c:dal_attachstatus 0name 'DAL_AM_AUD' dal_client d5eb5800
<6>[   17.644442] [q6audio.c:q6audio_initattach ADIE
<6>[   17.644841] [dal.c:dal_attachstatus 0name 'DAL_AM_AUD' dal_client d5eb5400
<3>[   17.665947
<
3>[   17.665958SMSMModem SMSM state changed to SMSM_RESET.
<
3>[   17.666632Notifystart reset 
nothing more for now
If you like my work, and want to help me click here to donate

Semc Debrand Engine Contributor

Member of Team XSonX10
---------------------------------------------------------
My contributions on XDA

Achotjan's remplacement Stock- Light Version

X10s Rom

Fast java sources decompiler
The Following User Says Thank You to Tof37 For This Useful Post: [ Click to Expand ]
 
FeraVolt
Old
(Last edited by FeraVolt; 13th January 2014 at 10:42 PM.)
#8  
FeraVolt's Avatar
Senior Member
Thanks Meter 13,022
Posts: 1,752
Join Date: Dec 2011

 
DONATE TO ME
Try this in config:
Code:
CONFIG_MSM_QDSP6=y
CONFIG_MSM_AUDIO_QDSP6=y //this one wants - SND_SOC_MSM_QDSP6_INTF
# CONFIG_MSM_QDSP6_APR is not set
# CONFIG_QSD_AUDIO is not set
p.s. can you send me your 51-android.rules file.. I messed up usb permissions and adb says:
error: insufficient permissions for device

I have this:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0777"


EDIT>nvm.. fixed changing device permissions to 666
The Following 3 Users Say Thank You to FeraVolt For This Useful Post: [ Click to Expand ]
 
Tof37
Old
(Last edited by Tof37; 14th January 2014 at 12:55 AM.)
#9  
Tof37's Avatar
Senior Member - OP
Thanks Meter 2,610
Posts: 607
Join Date: Oct 2009
Location: Tours

 
DONATE TO ME
Quote:
Originally Posted by FeraVolt View Post
Try this in config:
Code:
CONFIG_MSM_QDSP6=y
CONFIG_MSM_AUDIO_QDSP6=y //this one wants - SND_SOC_MSM_QDSP6_INTF
# CONFIG_MSM_QDSP6_APR is not set
# CONFIG_QSD_AUDIO is not set
p.s. can you send me your 51-android.rules file.. I messed up usb permissions and adb says:
error: insufficient permissions for device

I have this:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0fce", MODE="0777"


EDIT>nvm.. fixed changing device permissions to 666
Will try

BTW think where something is messing ... qdsp6 needs "ac" (qs6audio.c line 971)

PHP Code:
pr_info("[%s:%s] attach ADIE\n"__MM_FILE____func__);
adie dal_attach(ADIE_DAL_DEVICEADIE_DAL_PORT000);
if (!
adie) {
pr_err("[%s:%s] cannot attach to adie\n",
__MM_FILE____func__);
res = -ENODEV;
goto 
done;
}
if (
analog_ops->init)
analog_ops->init();

res 0;
ac_control ac
but ... if you look at the log on google drive (log 3.0.8 ... boot sur cm9, sans qdsp6)
you'll see that
PHP Code:
sysfscannot create duplicate filename '/class/power_supply/ac' 
I think the problem is there ... if I revert this commit
it doesn't work either cause mx17040 doesn't probe as it should...

let's sleep now
If you like my work, and want to help me click here to donate

Semc Debrand Engine Contributor

Member of Team XSonX10
---------------------------------------------------------
My contributions on XDA

Achotjan's remplacement Stock- Light Version

X10s Rom

Fast java sources decompiler
The Following 6 Users Say Thank You to Tof37 For This Useful Post: [ Click to Expand ]
 
FeraVolt
Old
#10  
FeraVolt's Avatar
Senior Member
Thanks Meter 13,022
Posts: 1,752
Join Date: Dec 2011

 
DONATE TO ME
How about this <mach/msm_qdsp6_audio.h>:
 
Code:
/* arch/arm/mach-msm/include/mach/msm_qdsp6_audio.h
 *
 * Copyright (C) 2009 Google, Inc.
 * Author: Brian Swetland <swetland@google.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef _MACH_MSM_QDSP6_Q6AUDIO_
#define _MACH_MSM_QDSP6_Q6AUDIO_

#define AUDIO_FLAG_READ		0
#define AUDIO_FLAG_WRITE	1
#define AUDIO_FLAG_INCALL_MIXED	2

#include <linux/wait.h>

struct audio_buffer {
	dma_addr_t phys;
	void *data;
	uint32_t size;
	uint32_t used;	/* 1 = CPU is waiting for DSP to consume this buf */
	uint32_t actual_size; /* actual number of bytes read by DSP */
};

struct audio_client {
	struct audio_buffer buf[2];
	int cpu_buf;	/* next buffer the CPU will touch */
	int dsp_buf;	/* next buffer the DSP will touch */
	int running;
	int session;

	wait_queue_head_t wait;
	struct dal_client *client;

	int cb_status;
	uint32_t flags;
};

/* Obtain a 16bit signed, interleaved audio channel of the specified
 * rate (Hz) and channels (1 or 2), with two buffers of bufsz bytes.
 */
struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
				      uint32_t channels, uint32_t flags,
				      uint32_t acdb_id);

struct audio_client *q6voice_open(uint32_t flags);

struct audio_client *q6audio_open_mp3(uint32_t bufsz, uint32_t rate,
				      uint32_t channels, uint32_t acdb_id);

struct audio_client *q6audio_open_dtmf(uint32_t rate, uint32_t channels,
							uint32_t acdb_id);
int q6audio_play_dtmf(struct audio_client *ac, uint16_t dtmf_hi,
			uint16_t dtmf_low, uint16_t duration, uint16_t rx_gain);

struct audio_client *q6audio_open_aac(uint32_t bufsz, uint32_t samplerate,
					uint32_t channels, uint32_t bitrate,
					uint32_t stream_format, uint32_t flags,
					uint32_t acdb_id);

struct audio_client *q6audio_open_qcp(uint32_t bufsz, uint32_t min_rate,
					uint32_t max_rate, uint32_t flags,
					uint32_t format, uint32_t acdb_id);

struct audio_client *q6audio_open_amrnb(uint32_t bufsz, uint32_t enc_mode,
					uint32_t dtx_enable, uint32_t flags,
					uint32_t acdb_id);

int q6audio_close(struct audio_client *ac);
int q6voice_close(struct audio_client *ac);
int q6audio_mp3_close(struct audio_client *ac);

int q6audio_read(struct audio_client *ac, struct audio_buffer *ab);
int q6audio_write(struct audio_client *ac, struct audio_buffer *ab);
int q6audio_async(struct audio_client *ac);

int q6audio_do_routing(uint32_t route, uint32_t acdb_id);
int q6audio_set_tx_mute(int mute);
int q6audio_reinit_acdb(char* filename);
int q6audio_update_acdb(uint32_t id_src, uint32_t id_dst);
int q6audio_set_rx_volume(int level);
int q6audio_set_stream_volume(struct audio_client *ac, int vol);
int q6audio_set_stream_eq_pcm(struct audio_client *ac, void *eq_config);

struct q6audio_analog_ops {
	void (*init)(void);
	void (*speaker_enable)(int en);
	void (*headset_enable)(int en);
	void (*receiver_enable)(int en);
	void (*bt_sco_enable)(int en);
	void (*int_mic_enable)(int en);
	void (*ext_mic_enable)(int en);
};

void q6audio_register_analog_ops(struct q6audio_analog_ops *ops);

/* signal non-recoverable DSP error so we can log and/or panic */
void q6audio_dsp_not_responding(void);

#endif

The Following 2 Users Say Thank You to FeraVolt For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes