- 博客(85)
- 收藏
- 关注
转载 init_task
版权声明:本文为博主原创文章,未经博主允许不得转载。init_task是kernel的第一个进程,0号进程,当kernel初始化完成后,它便化身为idle进程出现在我们的面前。一init_thread_unionunionthread_union init_thread_union __init_task_data = { INIT_THREAD_INFO(init_
2017-01-16 17:46:07
4148
原创 Usb4--resource资源申请使用
#define MSM_USB_BASE (motg->regs)#defineUSB_USBINTR (MSM_USB_BASE + 0x0148) Probe(){res = platform_get_resource_byname(pdev, IORESOURCE_MEM,"core");获取core的资源 motg->io_res =
2016-11-09 15:46:57
417
原创 Usb3--resource资源初始化
kernel_init //-----------------------kernel\init\main.c-->kernel_init_freeable -->do_basic_setup -->do_initcalls -->do_initcall_lev
2016-11-09 15:45:43
521
原创 Usb2--All nodes of dts
Kernel/of/base.cStatic intzll=0;struct device_node *of_find_node_by_path(const char *path){struct device_node *np = of_allnodes;unsigned long flags;if(zll ==0){zll = 1;for (; np; np
2016-11-09 15:42:46
636
原创 Usb1--irq
Kernel/drivers/of/irq.c unsignedint irq_of_parse_and_map(structdevice_node *dev, int index){struct of_irq oirq;if(strcmp(dev->name,"usb")== 0){pr_err("zll----0-dev->name=%s !\n",dev->nam
2016-11-09 15:41:15
367
原创 8926音频录音流程
一、 android本身对录音流程就有一个很完善的控制,能够很好的理解audiorecord服务的运作,对于理解和解决上行数据的处理有个很好的指导作用。AudioRecord和AudioTrack是音频上行和下行的两大重要服务,本文主要针对上行AudioRecord服务进行流程的详细说明。 二、具体代码流程如下:AudioRecord::set
2016-11-09 14:53:44
425
原创 8926音频播放流程
一、 android本身对播放流程就有一个很完善的控制,能够很好的理解AudioTrack服务的运作,对于理解和解决下行数据的处理有个很好的指导作用。AudioRecord和AudioTrack是音频上行和下行的两大重要服务,本文主要针对下行AudioTrack服务进行流程的详细说明。AudioTrack服务启动之后会把数据传给AudioFlinger,之后会传给hal,最后会传给DSP到
2016-11-09 14:46:45
622
原创 control调用流程
1.kernel 部分control控制codec寄存器流程 module_platform_driver(msm8x16_asoc_machine_driver)-------------------------kernel/sound/soc/msm/msm8x16.c ->msm8x16_asoc_machine_probe ->sn
2016-11-09 14:32:51
1086
原创 gpio
- qcom,pin-type-*:identifies the pin type. Pin types supported are 24 qcom,pin-type-gp: General purpose 25 qcom,pin-type-sdc: SDC Gpio
2016-11-09 11:14:47
298
转载 Device Tree(三):代码分析
一、前言Device Tree总共有三篇,分别是:1、为何要引入Device Tree,这个机制是用来解决什么问题的?(请参考引入Device Tree的原因)2、Device Tree的基础概念(请参考DT基础概念)3、ARM linux中和Device Tree相关的代码分析(这是本文的主题)本文主要内容是:以Device Tree相关的数据流分析为索引,对ARM
2016-11-09 10:28:36
491
转载 Device Tree(二):基本概念
一、前言一些背景知识(例如:为何要引入Device Tree,这个机制是用来解决什么问题的)请参考引入Device Tree的原因,本文主要是介绍DeviceTree的基础概念。简单的说,如果要使用Device Tree,首先用户要了解自己的硬件配置和系统运行参数,并把这些信息组织成Device Tree source file。通过DTC(Device TreeCompiler)
2016-11-09 10:27:54
467
转载 Device Tree(一):背景介绍
一、前言作为一个多年耕耘在linux 2.6.23内核的开发者,各个不同项目中各种不同周边外设驱动的开发以及各种琐碎的、扯皮的俗务占据了大部分的时间。当有机会下载3.14的内核并准备学习的时候,突然发现linux kernel对于我似乎变得非常的陌生了,各种新的机制,各种framework、各种新的概念让我感到阅读内核代码变得举步维艰。还好,剖析内核的热情还在,剩下的就交给时间的。首先
2016-11-09 10:27:00
387
原创 dtc工具解析
/kernel/scripts/dtc/livetree.cmerge_nodes-->delete_property_by_name-->delete_node_by_name -->delete_node void delete_node(struct node *node)287 {288 struct property *pr
2016-11-09 10:26:02
2862
原创 Node
/dts-v1/; / {#address-cells = ;#size-cells = ;model = "Qualcomm Technologies, Inc. MSM8976 MTP";compatible = "qcom,msm8976-mtp", "qcom,msm8976","qcom,mtp";qcom,msm-id = ;interrupt-pare
2016-11-09 10:25:03
630
转载 Dts- status
static struct platform_device *of_platform_device_create_pdata( struct device_node *np, const char *bus_id, void *platform_data,
2016-11-09 10:23:56
1409
原创 Dts-link
1、plt_dts.sh #!/bin/sh PLT_DIR=qcomPLT_DTS_NAME=$1PRODUCT_NAME=$2DIFF_RESULT=~/temp/diff_result.txtLINK_LIST=~/temp/link.listBOARD_DIRS=~/temp/board_dirs.txt creat_links(){BO
2016-11-09 10:23:15
394
原创 dts编译
Dtc -I dts -O dts -o test.dtsmsm8939-Cp5961-p0.dts Dtc -I dts -O dts -oteset0.dts test0000.dtb 反编译到teset0.dts中 随便放,放到你环境变量里就可嫌麻烦就放到和dtb,dts相同的目录(不推荐) Dtb编译一般形式:dtbTool-o
2016-11-09 10:21:36
1654
转载 (DT系列六)devicetree中数据和 struct device有什么关系
devicetree中数据和structdevice有什么关系总体来说,devicetree与structdevice的关系应该还是在其生成platformdevice的时候,一直传递的structdevice*parent参数。下面先把其源码中传递过程描述如下(仍以At91rm9200为例): 1,DT_MACHINE_START(at91sam_dt,"Atmel
2016-11-09 10:10:16
353
转载 (DT系列五)Linux kernel 是怎么将 devicetree中的内容生成plateform_device
Linux kernel 是怎么将devicetree中的内容生成plateform_device 1,实现场景(以VersatileExpress V2M为例说明其过程)以arch/arm/mach-vexpress/v2m.c为例,在该文件中的v2m_dt_init函数的作用就是利用 dt(device tree)结构初始化 platform device。static
2016-11-09 10:09:37
431
转载 (DT系列四)驱动加载中, 如何取得device tree中的属性
本文以At91rm9200平台为例,从源码实现的角度来分析驱动加载时,Devicetree的属性是如何取得的。 一:系统级初始化DT_MACHINE_START主要是定义"struct machine_desc"的类型,放在section(".arch.info.init"),是初始化数据,Kernel 起来之后将被丢弃。#defineDT_MACHINE_START(_name,
2016-11-09 10:08:59
572
转载 (DT系列三)系统启动时, dts 是怎么被加载的
一,主要问题:系统在启动的时候,是怎么加载 dts的;Lk,kernel中都应调查。 二:参考文字dts加载流程如下图所示: 启动过程中,bootloader(默认是bootable/bootloader/lk)会根据机器硬件信息选择合适的devicetree装入内存,把地址等相关信息传给kernel。kernel中,会根据传入的信息创建设备。
2016-11-09 10:08:24
554
转载 (DT系列二)device tree的书写规范
devicetree的书写规范下面从节点,属性,reg,ranges,中断控制器等几个方面叙述devicetree的书写规范。1,dts的基本元素:节点.dts(或者其include的.dtsi)基本元素为结点和属性。举例说明节点的概念:/ { node1 { a-string-property = "A string"; a-
2016-11-09 10:06:42
258
转载 (DT系列一)DTS结构及其编译方法
DTS结构及其编译方法 一:主要问题1,需要了解dtsi与dts的关系2,dts的结构模型3,dts是如何被编译的,以及编译后会生成一个什么文件. 二:参考文字1,DTS(devicetree source).dts文件是一种ASCII文本格式的DeviceTree描述。基本上,在ARMLinux内,一个.dts文件对应一个ARM的machine,一般放置在内核
2016-11-09 10:05:56
735
原创 dts加载流程
boot_linux_from_mmc |-> dt_table_offset=((uint32_t)image_addr+page_size+kernel_actual_ramdisk_actual+second_actual); ------------------------------找到dts的偏移地址 |->table = (structdt_tabl
2016-11-08 17:56:51
1366
转载 Pinctrl-bindings.txt
Hardware modulesthat control pin multiplexing or configuration parameterssuch aspull-up/down, tri-state, drive-strength etc are designated as pincontrollers. Eachpin controller must be represented
2016-11-08 17:51:54
566
转载 msm_pinctrl.txt
MSM TLMM pinmuxcontroller Qualcomm MSMintegrates a GPIO and Pin mux/config hardware, (TOP Level ModeMultiplexer in shortTLMM). It controls the input/output settings on theavailable pads/pinsan
2016-11-08 17:51:02
560
转载 MACHINE_START与MACHINE_END
在移植Linux时,有个结构体需要填写,它以MACHINE_START开始并以MACHINE_END结束,如下mini2440开发板的移植为示例 [cpp] view plaincopyMACHINE_START(MINI2440, "MINI2440") .phys_io = S3C2410_PA_UART, .io_pg_offst
2016-11-08 17:50:07
200
转载 Device Tree起源
1. ARM Device Tree起源LinusTorvalds在2011年3月17日的ARM Linux邮件列表宣称“this whole ARM thing is a f*cking pain inthe ass”,引发ARM Linux社区的地震,随后ARM社区进行了一系列的重大修正。在过去的ARMLinux中,arch/arm/plat-xxx和arch/arm/mach-xxx
2016-11-08 17:48:54
488
转载 Device Tree常用方法解析
Device Tree在Linux内核驱动中的使用源于2011年3月17日Linus Torvalds在ARMLinux邮件列表中的一封邮件,他宣称“this whole ARM thing is a f*cking pain in theass”,并提倡学习PowerPC等其他架构已经成熟使用的Device Tree技术。自此,Device Tree正式进入ARM社区的视野中。1. 作用
2016-11-08 17:47:42
333
转载 Android启动流程 -- linux kernel
linux启动 一、zImage是怎样炼成的? zImage是linux内核编译之后产生的最终文件,它的生成过程比较复杂,这里不谈编译过程,只聊聊编译的最后阶段: 1. arm-linux-gnu-ld用arch/arm/kernel/vmlinux.lds、arch/arm/kernel/head.o、arch/arm/kernel/init_
2016-11-08 17:14:53
404
原创 Uart-log-ALL
[156940] fastboot: download:009ead28[158410] fastboot: flash:boot[158410] boot is not yl image[158610] fastboot: reboot[158610] rebooting the device[158610] SCM call: 0x2000110 failed with :
2016-11-08 17:12:46
6194
转载 Linux内核中的初始化initcall_t
基于Linux 2.6.32include\asm-generic\Vmlinux.lds.h中有如下定义:这等于是安排了名称如.initcall[s].init的一系列section的顺序,level越小,越靠前。符号__initcall_start记录了这片区域的开始,__initcall_end符号记录了这片区域的结束。__early_initcall_end则将这片区域更进
2016-11-08 17:08:31
1064
原创 .initcall##level##.init
//-----------------------kernel/init/main.c static void __init do_initcall_level(int level){extern const struct kernel_param __start___param[],__stop___param[];initcall_t *fn; strcpy(sta
2016-11-08 17:07:21
1133
原创 cmdline值
[1380] cmdline: console=ttyHSL0,115200,n8androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhcilpm_levels.sleep_disabled=1logl
2016-11-08 17:05:10
1156
转载 cmdline传递
uboot向kernel的传参机制——bootm与tags 一uboot 如何启动 kernel1 do_bootmuboot下使用bootm命令启动内核镜像文件uImage,uImage是在zImage头添加了64字节的镜像信息供uboot解析使用,具体这64字节头的内容,我们在分析bootm命令的时候就会一一说到,那直接来看bootm命令。在common
2016-11-08 15:46:03
1676
转载 .init.setup 位置
在内核里经常可以看到__init,__devinit这样的语句,这都是在init.h中定义的宏,gcc在编译时会将被修饰的内容放到这些宏所代表的section。其典型的定义如下:#define __init __section(.init.text) __cold notrace#define __initdata __section(.init.data)
2016-11-08 15:44:29
445
原创 early_param流程
Linux内核源码中多处会看到诸如__init,__initdata,__exitdata的关键字, 大部分这样的关键字定义在include/linux/init.h头文件中,它们都会在编译连接阶段被实现处理。 #define __init __section(.init.text) __cold notrace __init标记的数据被存储在.init.text节 #de
2016-11-08 15:32:44
2577
原创 Start_kernel中的参数
[ 0.000000]@0 zll----early=0,str=rdinit=[ 0.000000]@0 zll----early=0,str=init=[ 0.000000]@0 zll----early=1,str=loglevel[ 0.000000]@0 zll----early=1,str=quiet[ 0.000000]@0 zll---
2016-11-08 15:14:28
460
原创 uart之kenel调用流程
Start_kernel()--------------------------------------kernel\init\main.c-->setup_arch(&command_line);----------------解析console=-->parse_early_param();-----------------------解析androidboot.mode=charge
2016-11-08 15:12:25
258
原创 uart调试
0.000000]@0 CPU: 0 PID: 0 Comm: swapper Nottainted 3.10.84-gc02f4f9-03166-g8c8a4c4-dirty #40[ 0.000000]@0 Call trace:[ 0.000000]@0 []dump_backtrace+0x0/0x270[ 0.000000]@0 []show_stack+0
2016-11-08 15:10:32
562
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人