[Q] kernel developing/tweaking - Thunderbolt Q&A, Help & Troubleshooting

Just wondering what pre-requisites were required. Are all of you Kernel devs actual programmers. What languages and any other skills would be required to understand what is going on.
Adrynalyne's guide is awesome and I was actually able to produce something usable , by following the directions, but understanding for example the Make command line we had to use, ARCH=arm, etc ????? have no idea what that line actually means, but would like to.
I have multiple certs, network+, active directory etc, and learned it all on my own so im not worried about understanding, just looking to be pointed in the right direction so as not to waste time learning languages or whatever that would not be relative.
Thanks again for any info.

Make calls the makefile and follows instructions contained within.
J # tells gcc compiler how many threads to use. 1 thread per core. Rule is # of cores +1. This can increase compile speed tremendously.
ARCH specifies the CPU architecture.
Examples are ARM, x86, and x86-64.
The rest tells gcc to compile using the toolchain which allows gcc to compile for the specified architecture.
Sent from my ADR6400L using XDA App

adrynalyne said:
Make calls the makefile and follows instructions contained within.
J # tells gcc compiler how many threads to use. 1 thread per core. Rule is # of cores +1. This can increase compile speed tremendously.
ARCH specifies the CPU architecture.
Examples are ARM, x86, and x86-64.
The rest tells gcc to compile using the toolchain which allows gcc to compile for the specified architecture.
Sent from my ADR6400L using XDA App
Click to expand...
Click to collapse
As always, thank you!

Anyone else have any words of advice on the topic question.
Thanks again.

you dont necessarily need to be a super coder. for example here is a common thing all the n1 kernel devs do to boost the audio in the nexus one in the arch/arm.audio.c file and board-mahimahi.audio.c file.
STOCK
PHP:
[Q6_HW_HANDSET] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_HEADSET] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_SPEAKER] = {
.min_gain = -1500,
.max_gain = 0,
},
[Q6_HW_TTY] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_BT_SCO] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_BT_A2DP] = {
.min_gain = -2000,
.max_gain = 0,
},
and the new values to "boost" volume
PHP:
[Q6_HW_HANDSET] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_HEADSET] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_SPEAKER] = {
.min_gain = -2000,
.max_gain = 800,
},
[Q6_HW_TTY] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_BT_SCO] = {
.min_gain = -2000,
.max_gain = 800,
},
[Q6_HW_BT_A2DP] = {
.min_gain = -2000,
.max_gain = 800,
},
that's standard for any kernel released for that device, and its pretty easy to do. i've pulled the source and compiled my own kernel many times, but i am not a good coder at all, just a few classes in college. i managed to make changes to the battery driver and get it incorporated into the cyan repo, so i definitely think you should look into it. there is nothing more rewarding then contributing back to the community.
also take a look at the cyanogen kernel, and follow the daily commits and see the type of changes made. some will be bug fixes, but you can go way back in time and see major edits as well.
go here to the kernel:
https://github.com/CyanogenMod/cm-kernel
then click COMMITS on the top. then each commit, click on the description text and it will show you the old vs new code. it will show you what the original code was, and what that commit replaced that code with. its very insightful for something like this.
it also is a good way to see what is happening with your favorite ROMs, you just have to find the repo for the ROM of your choice. cheers.

RogerPodacter said:
you dont necessarily need to be a super coder. for example here is a common thing all the n1 kernel devs do to boost the audio in the nexus one in the arch/arm.audio.c file and board-mahimahi.audio.c file.
STOCK
PHP:
[Q6_HW_HANDSET] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_HEADSET] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_SPEAKER] = {
.min_gain = -1500,
.max_gain = 0,
},
[Q6_HW_TTY] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_BT_SCO] = {
.min_gain = -2000,
.max_gain = 0,
},
[Q6_HW_BT_A2DP] = {
.min_gain = -2000,
.max_gain = 0,
},
and the new values to "boost" volume
PHP:
[Q6_HW_HANDSET] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_HEADSET] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_SPEAKER] = {
.min_gain = -2000,
.max_gain = 800,
},
[Q6_HW_TTY] = {
.min_gain = -1500,
.max_gain = 1100,
},
[Q6_HW_BT_SCO] = {
.min_gain = -2000,
.max_gain = 800,
},
[Q6_HW_BT_A2DP] = {
.min_gain = -2000,
.max_gain = 800,
},
that's standard for any kernel released for that device, and its pretty easy to do. i've pulled the source and compiled my own kernel many times, but i am not a good coder at all, just a few classes in college. i managed to make changes to the battery driver and get it incorporated into the cyan repo, so i definitely think you should look into it. there is nothing more rewarding then contributing back to the community.
also take a look at the cyanogen kernel, and follow the daily commits and see the type of changes made. some will be bug fixes, but you can go way back in time and see major edits as well.
go here to the kernel:
https://github.com/CyanogenMod/cm-kernel
then click COMMITS on the top. then each commit, click on the description text and it will show you the old vs new code. it will show you what the original code was, and what that commit replaced that code with. its very insightful for something like this.
it also is a good way to see what is happening with your favorite ROMs, you just have to find the repo for the ROM of your choice. cheers.
Click to expand...
Click to collapse
Very helpful and a great place to start, much appreciated, its funny posted this example in particular as i have been looking around on how to change the max possible volume of my phone, again thanks.
Its funny looking around the directories of the kernel source theres a sound subdirectory, which I have been looking for the above tweaks, but its not where I expected to find it.
Seems alot of stuff is in the Arch, Arm directories, what is the signifigance?

also cant find those particular battery tweaks in the mecha kernel. any idea where that code is in the mecha kernel.

happimeal said:
also cant find those particular battery tweaks in the mecha kernel. any idea where that code is in the mecha kernel.
Click to expand...
Click to collapse
here is the enhanced battery driver i did:
https://github.com/CyanogenMod/cm-k...a76d7a3bb91ec3#drivers/power/ds2784_battery.c
it looks a little overwhelming. but it literally took my months of research, compiling my own test kernel, before i finally got those couple hunder lines added and working. prior to that i had no experience except c++ class from college, and used google to learn and learn some more.
the driver is in drivers/power/ds2784_battery.c and the additions start at line 401 if you want to see the whole thing:
https://github.com/CyanogenMod/cm-k...a76d7a3bb91ec3/drivers/power/ds2784_battery.c
it was a great feeling once it was all done. check my sig for the link to the app we made too, which actually interacts with the enhanced driver and changes battery register addresses etc.
here's my repo for just the app (java code is what android apps are written in. the kernel is linux/c++). go into the SRC folder is where all the main stuff is.
http://github.com/R0gerP0dacter/BatteryCalibrator
Edit: actually I originally made a detailed commented driver version for someone who wasn't familiar with the project to follow the work. This would be helpful for you.
http://github.com/R0gerP0dacter/n1batcal/blob/master/ds2784_battery.c

Thank you very much for all this info.
Anybody have any idea where the sound/volume data is.

the audio will likely be in that same arch/arm folder. i'd go to the HTC developer site and download the kernel source code, since it has been released already. look thru and you should be able to find it.

Related

customizing XDA's today screen

Is it possible to customize the XDA's today screen (i.e. by using XML) as you can do with the Orange's SPV ?
Download Microsoft's Theme Generator...
http://www.microsoft.com/mobile/pocketpc/downloads/powertoys.asp
There are some other goodies on that page aswell.
Good luck!
Powertoy is not what I am looking for: the idea is not only changing the background image but to organize all the datas on the screen as and where you wish (date, time, numbers of emails received, fonts, etc.) as you can do on smarphone 2002 changing the today screen's script in XML.
For examples what you can do with Smartphone 2002:
http://www.smartphony.org/stories.php?topic=32
It's a bit more complicated with PPC 2002. Unlike smartphone, it is an API to change the contents of 'Today'. Each line is loaded as a type of 'snap in' dll.
Do you I could find some examples of that kind of work ?
It is really a pain in the ass
But this works fine... 8)
#include "stdafx.h"
#include <todaycmn.h>
#define IDI_ICON1 101
HINSTANCE Instance;
BOOL Refresh;
HICON hIcon;
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
PAINTSTRUCT ps;
RECT rect;
switch (msg) {
case WM_TODAYCUSTOM_CLEARCACHE:
break;
case WM_TODAYCUSTOM_QUERYREFRESHCACHE:
if (Refresh) {
Refresh = FALSE;
((TODAYLISTITEM *)(wparam))->cyp = 20;
return TRUE;
} else {
return FALSE;
}
case WM_ERASEBKGND:
{
TODAYDRAWWATERMARKINFO dwi;
dwi.hwnd = hwnd;
dwi.hdc = (HDC)wparam;
GetClientRect(hwnd, &(dwi.rc));
SendMessage(GetParent(hwnd), TODAYM_DRAWWATERMARK, 0, (LPARAM)&dwi);
return 1;
}
case WM_PAINT:
BeginPaint(hwnd, &ps);
GetWindowRect(hwnd, &rect);
SetBkMode(ps.hdc, TRANSPARENT);
hIcon = (HICON)LoadImage(Instance,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,16,16,LR_DEFAULTCOLOR );
DrawIcon(ps.hdc, 2, 0, hIcon);
DestroyIcon(hIcon);
LOGFONT lf;
HFONT hSysFont;
HFONT hFont, hFontOld;
hSysFont = (HFONT) GetStockObject(SYSTEM_FONT);
GetObject(hSysFont, sizeof(LOGFONT), &lf);
lf.lfWeight = FW_BOLD;
lf.lfHeight = (long) -((8.0 * (double)GetDeviceCaps(ps.hdc, LOGPIXELSY) / 72.0)+.5);
hFont = CreateFontIndirect(&lf);
hFontOld = (HFONT) SelectObject(ps.hdc, hFont);
SetTextColor(ps.hdc, SendMessage(GetParent(hwnd), TODAYM_GETCOLOR, (WPARAM)TODAYCOLOR_TEXT, NULL));
GetClientRect(hwnd, &rect);
DrawText(ps.hdc, TEXT("Text you want to enter"), -1, &rect, DT_LEFT | DT_TOP | DT_NOCLIP);
SelectObject(ps.hdc, hFontOld);
DeleteObject(hFont);
EndPaint(hwnd, &ps);
break;
case WM_LBUTTONUP:
// Whatever you want to occur when the button is pressed //
CreateProcess(TEXT("iexplore.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
break;
default:
return DefWindowProc(hwnd, msg, wparam, lparam);
}
return 0;
}
HWND APIENTRY InitializeCustomItem(TODAYLISTITEM *tli, HWND parent)
{
if (!tli->fEnabled) {
return NULL;
}
Instance = tli->hinstDLL;
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = Instance;
wc.hIcon = 0;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH)COLOR_BACKGROUND + 1;
wc.lpszMenuName = NULL;
wc.lpszClassName = TEXT("RegisterClassName");
UnregisterClass(TEXT("RegisterClassName"), Instance);
RegisterClass(&wc);
Refresh = TRUE;
return CreateWindow(TEXT("RegisterClassName"), TEXT("RegisterClassName"), WS_VISIBLE | WS_CHILD, CW_DEFAULT, CW_DEFAULT, 0, 0, parent, NULL, Instance, NULL);
}
Thank's !
Is there somewhere a technical documentation about that ?

Voltages of Each VDD in MSM7201A

Does anyone know the exact voltage at every VDD in the MSM7201A? I'm looking at testing some undervolting but I need more info.
http://android.git.kernel.org/?p=kernel/msm.git;a=blob_plain;f=arch/arm/mach-msm/acpuclock.c;hb=HEAD
/* MSM7201A Levels 3-6 all correspond to 1.2V, level 7 corresponds to 1.325V. */
enum {
VDD_0 = 0,
VDD_1 = 1,
VDD_2 = 2,
VDD_3 = 3,
VDD_4 = 3,
VDD_5 = 3,
VDD_6 = 3,
VDD_7 = 7,
VDD_END
};

Building kernel error.

Trying to build a kernel from source for ZTE Vec 4G(msm8226 with 4G), but I'm getting an error I don't know how to fix.
I've already fixed some, as I have quiet a bit of C/C++ knowledge, but not this one:
Code:
CC drivers/media/platform/msm/vidc/msm_venc.o
drivers/media/platform/msm/vidc/msm_venc.c: In function 'try_set_ctrl':
drivers/media/platform/msm/vidc/msm_venc.c:1331: error: unknown field 'val' specified in initializer
drivers/media/platform/msm/vidc/msm_venc.c:1405: error: unknown field 'val' specified in initializer
Case that contains the first error line:
Code:
case V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES:
{
int num_p, num_b;
[COLOR="Red"]struct v4l2_ctrl update_ctrl = {.id = 0, .val = 0};[/COLOR]
if (ctrl->id == V4L2_CID_MPEG_VIDEO_H264_I_PERIOD &&
inst->fmts[CAPTURE_PORT]->fourcc != V4L2_PIX_FMT_H264 &&
inst->fmts[CAPTURE_PORT]->fourcc !=
V4L2_PIX_FMT_H264_NO_SC) {
dprintk(VIDC_ERR, "Control 0x%x only valid for H264",
ctrl->id);
rc = -ENOTSUPP;
break;
}
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES);
num_b = temp_ctrl->val;
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES);
num_p = temp_ctrl->val;
/* V4L2_CID_MPEG_VIDEO_H264_I_PERIOD and _NUM_P_FRAMES are
* implicitly tied to each other. If either is adjusted,
* the other needs to be adjusted in a complementary manner.
* Ideally we adjust _NUM_B_FRAMES as well but we'll leave it
* alone for now */
if (ctrl->id == V4L2_CID_MPEG_VIDEO_H264_I_PERIOD) {
num_p = ctrl->val - 1 - num_b;
update_ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES;
update_ctrl.val = num_p;
} else if (ctrl->id == V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES) {
num_p = ctrl->val;
update_ctrl.id = V4L2_CID_MPEG_VIDEO_H264_I_PERIOD;
update_ctrl.val = num_p + num_b;
} else if (ctrl->id == V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES) {
num_b = ctrl->val;
update_ctrl.id = V4L2_CID_MPEG_VIDEO_H264_I_PERIOD;
update_ctrl.val = num_p + num_b;
}
if (update_ctrl.id) {
temp_ctrl = TRY_GET_CTRL(update_ctrl.id);
temp_ctrl->val = update_ctrl.val;
}
if (num_b) {
u32 max_num_b_frames = MAX_NUM_B_FRAMES;
property_id = HAL_PARAM_VENC_MAX_NUM_B_FRAMES;
pdata = &max_num_b_frames;
rc = call_hfi_op(hdev, session_set_property,
(void *)inst->session, property_id, pdata);
if (rc) {
dprintk(VIDC_ERR,
"Failed : Setprop MAX_NUM_B_FRAMES %d",
rc);
break;
}
}
property_id = HAL_CONFIG_VENC_INTRA_PERIOD;
intra_period.pframes = num_p;
intra_period.bframes = num_b;
pdata = &intra_period;
break;
}
Code:
case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
{
int final_mode = 0;
[COLOR="Red"]struct v4l2_ctrl update_ctrl = {.id = 0, .val = 0};[/COLOR]
/* V4L2_CID_MPEG_VIDEO_BITRATE_MODE and _RATE_CONTROL
* manipulate the same thing. If one control's state
* changes, try to mirror the state in the other control's
* value */
if (ctrl->id == V4L2_CID_MPEG_VIDEO_BITRATE_MODE) {
if (ctrl->val == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) {
final_mode = HAL_RATE_CONTROL_VBR_CFR;
update_ctrl.val =
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR;
} else {/* ...if (ctrl->val == _BITRATE_MODE_CBR) */
final_mode = HAL_RATE_CONTROL_CBR_CFR;
update_ctrl.val =
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_CFR;
}
update_ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL;
} else if (ctrl->id == V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL) {
switch (ctrl->val) {
case V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_OFF:
case V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_VFR:
case V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR:
update_ctrl.val =
V4L2_MPEG_VIDEO_BITRATE_MODE_VBR;
case V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_VFR:
case V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_CFR:
update_ctrl.val =
V4L2_MPEG_VIDEO_BITRATE_MODE_CBR;
}
final_mode = ctrl->val;
update_ctrl.id = V4L2_CID_MPEG_VIDEO_BITRATE_MODE;
}
if (update_ctrl.id) {
temp_ctrl = TRY_GET_CTRL(update_ctrl.id);
temp_ctrl->val = update_ctrl.val;
}
property_id = HAL_PARAM_VENC_RATE_CONTROL;
property_val = final_mode;
pdata = &property_val;
break;
}
Function calls:
Code:
for (c = 0; c < ctrl->ncontrols; ++c) {
if (ctrl->cluster[c]->is_new) {
struct v4l2_ctrl *temp = ctrl->cluster[c];
[COLOR="Red"]rc = try_set_ctrl(inst, temp);[/COLOR]
if (rc) {
dprintk(VIDC_ERR, "Failed setting %s (%x)",
v4l2_ctrl_get_name(temp->id),
temp->id);
break;
}
}
}
Whole file attached.
From the error, I can tell that .val isn't declared, or something similar, but I need help from an expert to fix it.
Faced with same problem for Alcatel OT Fire E 6015X. My solution:
- Install Android NDK (ArchLinux):
Code:
pacman -S android-ndk
- Add path:
Code:
export PATH=/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin:${PATH}
- Run build:
Code:
make CROSS_COMPILE=arm-linux-androideabi- ARCH=arm zImage
need to replace every .val for .cur.val, the problem is that the val variable is declared within a union named cur inside the v4l2_ctrl structure. So in order for the Compiler to recognize it should be addressed thru the union var

What Should I Do If a HUAWEI Quick App Freezes When the canvas Component Draws an Image Using setInterval?

Symptom: In a quick app, the setInterval function is used to cyclically execute the code for using canvas. However, the quick app freezes when rendering an image on a Huawei phone.
The code where the exception occurs is as follows:
JavaScript:
click0() {
this.speed = 0.3
let ctx = this.$element('canvas').getContext('2d')
setInterval(() => {
this.num0 += 2
this.noise = Math.min(0.5, 1) * this.MAX
this._draw(ctx)
this.MAX <= 200 && (this.MAX += 4)
}, 20)
},
_draw(ctx) {
this.phase = (this.phase + this.speed) % (Math.PI * 64)
ctx.clearRect(0, 0, this.width, this.height)
this._drawLine(ctx, -2, 'rgba(0, 194, 255, 0.2)')
this._drawLine(ctx, -6, 'rgba(0, 194, 255, 0.4)')
this._drawLine(ctx, 4, 'rgba(0, 194, 255, 0.6)')
this._drawLine(ctx, 2, 'rgba(0, 194, 255, 0.8)')
this._drawLine(ctx, 1, 'rgba(0, 194, 255, 1)', 4)
},
Cause Analysis:
The canvas drawing in the this._draw() method takes a long time, at least 100 ms. However, the time interval is only 20 ms. Huawei Quick App Loader will execute the code again after 20 ms, which is much shorter than 100 ms, causing the drawing to stutter.
Solution:
You can first obtain the service provider by calling the API for querying device information to determine whether the quick app is supported by Huawei Quick App Loader. If so, set the time interval to longer than 100 ms. The sample code is as follows (please refer to the red portions):
JavaScript:
onShow: function () {
var that = this
device.getInfo({
success: function (ret) {
console.log("handling success:", JSON.stringify(ret));
that.engineProvider = ret.engineProvider;
},
fail: function (erromsg, errocode) {
console.log("message:", erromsg, errocode);
}
})
},
click0() {
var that = this
this.speed = 0.3
console.log(that.engineProvider)
let ctx = this.$element('canvas').getContext('2d')
if (that.engineProvider === "huawei") {
setInterval(() => {
this.num0 += 2
this.noise = Math.min(0.5, 1) * this.MAX
this._draw(ctx)
this.MAX <= 200 && (this.MAX += 4)
}, 120)
} else {
setInterval(() => {
this.num0 += 2
this.noise = Math.min(0.5, 1) * this.MAX
this._draw(ctx)
this.MAX <= 200 && (this.MAX += 4)
}, 20)
}
},
_draw(ctx) {
this.phase = (this.phase + this.speed) % (Math.PI * 64)
ctx.clearRect(0, 0, this.width, this.height)
this._drawLine(ctx, -2, 'rgba(0, 194, 255, 0.2)')
this._drawLine(ctx, -6, 'rgba(0, 194, 255, 0.4)')
this._drawLine(ctx, 4, 'rgba(0, 194, 255, 0.6)')
this._drawLine(ctx, 2, 'rgba(0, 194, 255, 0.8)')
this._drawLine(ctx, 1, 'rgba(0, 194, 255, 1)', 4)
},
_drawLine(ctx, attenuation, color, width) {
ctx.save()
ctx.moveTo(0, 0);
ctx.beginPath();
ctx.strokeStyle = color;
ctx.lineWidth = width || 1;
var x, y;
for (var i = -this.K; i <= this.K; i += 0.01) {
x = this.width * ((i + this.K) / (this.K * 2))
y = this.height / 2 + this.noise * this._globalAttenuationFn(i) * (1 / attenuation) * Math.sin(this.F * i - this.phase)
ctx.lineTo(x, y)
}
ctx.stroke()
ctx.restore()
},
References:
Introduction to the canvas API:
https://developer.huawei.com/consumer/en/doc/development/quickApp-References/quickapp-api-canvas
Quick app materials: https://developer.huawei.com/consumer/en/doc/development/quickApp-Guides/quickapp-whitepaper

Problem about kernel compilation, "Warning (reg_format)"

Hi all. I'm trying to compile the kernel for my HTC 5G HUB, as a first step in transforming it into a great IoT device.
It has a Snapdragon 855 SOC and runs Android 9.0.
After more than a week of work, I tried out a mostly correct environment and solved most of problems by myself, but there are still some issues that are bothering me.
I'm not expecting anyone to helping me solve problems hand by hand, but just hoping someone experienced in similar devices(Pixel 4; Mi 9; OnePlus 7, etc...) will give me some clues. Thanks!
1. Device Tree Compiler Warning
At the beginning, I got lots of warnings about"Warning (reg_format)" in various of nodes. I managed to resolve these warnings by carefully adding `#address-cells` and `#size-cells` in their parent node. Except for the following two.
Code:
Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Warning (reg_format): "reg" property in /[email protected]/__overlay__/qcom,[email protected] has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
Take smb1390 for example, its content is shown as below:
Code:
#include <dt-bindings/interrupt-controller/irq.h>
smb1390: qcom,[email protected] {
compatible = "qcom,i2c-pmic";
reg = <0x10>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&spmi_bus>;
interrupts = <0x2 0xC5 0x0 IRQ_TYPE_LEVEL_LOW>;
interrupt_names = "smb1390";
interrupt-controller;
#interrupt-cells = <3>;
qcom,periph-map = <0x10>;
status = "disabled";
smb1390_revid: qcom,revid {
compatible = "qcom,qpnp-revid";
reg = <0x100>;
};
smb1390_charger: qcom,charge_pump {
compatible = "qcom,smb1390-charger";
qcom,pmic-revid = <&smb1390_revid>;
interrupt-parent = <&smb1390>;
status = "disabled";
qcom,core {
interrupts = <0x10 0x0 IRQ_TYPE_EDGE_BOTH>,
<0x10 0x1 IRQ_TYPE_EDGE_BOTH>,
<0x10 0x2 IRQ_TYPE_EDGE_BOTH>,
<0x10 0x3 IRQ_TYPE_EDGE_BOTH>,
<0x10 0x4 IRQ_TYPE_EDGE_BOTH>,
<0x10 0x5 IRQ_TYPE_EDGE_RISING>,
<0x10 0x6 IRQ_TYPE_EDGE_RISING>,
<0x10 0x7 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "switcher-off-window",
"switcher-off-fault",
"tsd-fault",
"irev-fault",
"vph-ov-hard",
"vph-ov-soft",
"ilim",
"temp-alarm";
};
};
};
and it is included by sm8150-qrd.dtsi, sm8150-sdx50m-qrd.dtsi and sm8150-mtp.dtsi like this
Code:
&qupv3_se4_i2c {
#include "smb1390.dtsi"
#include "smb1355.dtsi"
};
Code:
&smb1390 {
pinctrl-names = "default";
pinctrl-0 = <&smb_stat_default>;
status = "ok";
};
&smb1390_charger {
io-channels = <&pm8150b_vadc ADC_AMUX_THM2>;
io-channel-names = "cp_die_temp";
status = "ok";
};
searching qupv3_se4_i2c I got this in sm8150-audio-rt5-xb.dtsi (RTX is the codename of HTC 5G HUB)
Code:
&soc{
/* TI config for spk chip */
[email protected] { /* qupv3_se4_i2c */
#address-cells = <1>;
#size-cells = <0>;
[email protected] {
...
};
};
};
I believe tas2557s is an unrelated device so I ignored the details of this.
So, where is the problem?
2. vmlinux warning at the end of compilation
Code:
WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned.
Fortunately, they were only warnings instead of errors. So I was still able to complete the entire compilation process.
If these problems are hard to fix easily, I'd like to know if I can safely ignore them.
My build environment:
Ubuntu 14.04 in docker
aarch64-linux-android-4.9
clang-4691093
DTC from AOSP 9.0.0. when I run "dtc -v", it told me "1.4.2"
You can get kernel source code from here

Categories

Resources