€•¬uŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ7/translations/zh_CN/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/zh_TW/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/it_IT/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ja_JP/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/ko_KR/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ7/translations/sp_SP/trace/coresight/coresight-cpu-debug”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒCoresight CPU Debug Module”h]”hŒCoresight CPU Debug Module”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒQ/var/lib/git/docbuild/linux/Documentation/trace/coresight/coresight-cpu-debug.rst”h KubhŒ block_quote”“”)”}”(hŒC:Author: Leo Yan :Date: April 5th, 2017 ”h]”hŒ field_list”“”)”}”(hhh]”(hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒAuthor”h]”hŒAuthor”…””}”(hhÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhhÄhŸh¶h KubhŒ field_body”“”)”}”(hŒLeo Yan ”h]”hŒ paragraph”“”)”}”(hhÛh]”(hŒ Leo Yan <”…””}”(hhßhžhhŸNh NubhŒ reference”“”)”}”(hŒleo.yan@linaro.org”h]”hŒleo.yan@linaro.org”…””}”(hhèhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:leo.yan@linaro.org”uh1hæhhßubhŒ>”…””}”(hhßhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KhhÙubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hhÄubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh¶h Khh¿ubhÃ)”}”(hhh]”(hÈ)”}”(hŒDate”h]”hŒDate”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhjhŸh¶h KubhØ)”}”(hŒApril 5th, 2017 ”h]”hÞ)”}”(hŒApril 5th, 2017”h]”hŒApril 5th, 2017”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh¶h Khh¿ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h½hh¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hjLhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjIhžhhŸh¶h K ubhÞ)”}”(hXâCoresight CPU debug module is defined in ARMv8-a architecture reference manual (ARM DDI 0487A.k) Chapter 'Part H: External debug', the CPU can integrate debug module and it is mainly used for two modes: self-hosted debug and external debug. Usually the external debug mode is well known as the external debugger connects with SoC from JTAG port; on the other hand the program can explore debugging method which rely on self-hosted debug mode, this document is to focus on this part.”h]”hXæCoresight CPU debug module is defined in ARMv8-a architecture reference manual (ARM DDI 0487A.k) Chapter ‘Part H: External debug’, the CPU can integrate debug module and it is mainly used for two modes: self-hosted debug and external debug. Usually the external debug mode is well known as the external debugger connects with SoC from JTAG port; on the other hand the program can explore debugging method which rely on self-hosted debug mode, this document is to focus on this part.”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K hjIhžhubhÞ)”}”(hXäThe debug module provides sample-based profiling extension, which can be used to sample CPU program counter, secure state and exception level, etc; usually every CPU has one dedicated debug module to be connected. Based on self-hosted debug mechanism, Linux kernel can access these related registers from mmio region when the kernel panic happens. The callback notifier for kernel panic will dump related registers for every CPU; finally this is good for assistant analysis for panic.”h]”hXäThe debug module provides sample-based profiling extension, which can be used to sample CPU program counter, secure state and exception level, etc; usually every CPU has one dedicated debug module to be connected. Based on self-hosted debug mechanism, Linux kernel can access these related registers from mmio region when the kernel panic happens. The callback notifier for kernel panic will dump related registers for every CPU; finally this is good for assistant analysis for panic.”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KhjIhžhubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K ubh¢)”}”(hhh]”(h§)”}”(hŒImplementation”h]”hŒImplementation”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj~hžhhŸh¶h KubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hXDuring driver registration, it uses EDDEVID and EDDEVID1 - two device ID registers to decide if sample-based profiling is implemented or not. On some platforms this hardware feature is fully or partially implemented; and if this feature is not supported then registration will fail. ”h]”hÞ)”}”(hXDuring driver registration, it uses EDDEVID and EDDEVID1 - two device ID registers to decide if sample-based profiling is implemented or not. On some platforms this hardware feature is fully or partially implemented; and if this feature is not supported then registration will fail.”h]”hXDuring driver registration, it uses EDDEVID and EDDEVID1 - two device ID registers to decide if sample-based profiling is implemented or not. On some platforms this hardware feature is fully or partially implemented; and if this feature is not supported then registration will fail.”…””}”(hjšhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h Khj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1j”hj‘hžhhŸh¶h Nubj•)”}”(hXˆAt the time this documentation was written, the debug driver mainly relies on information gathered by the kernel panic callback notifier from three sampling registers: EDPCSR, EDVIDSR and EDCIDSR: from EDPCSR we can get program counter; EDVIDSR has information for secure state, exception level, bit width, etc; EDCIDSR is context ID value which contains the sampled value of CONTEXTIDR_EL1. ”h]”hÞ)”}”(hX‡At the time this documentation was written, the debug driver mainly relies on information gathered by the kernel panic callback notifier from three sampling registers: EDPCSR, EDVIDSR and EDCIDSR: from EDPCSR we can get program counter; EDVIDSR has information for secure state, exception level, bit width, etc; EDCIDSR is context ID value which contains the sampled value of CONTEXTIDR_EL1.”h]”hX‡At the time this documentation was written, the debug driver mainly relies on information gathered by the kernel panic callback notifier from three sampling registers: EDPCSR, EDVIDSR and EDCIDSR: from EDPCSR we can get program counter; EDVIDSR has information for secure state, exception level, bit width, etc; EDCIDSR is context ID value which contains the sampled value of CONTEXTIDR_EL1.”…””}”(hj²hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K$hj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1j”hj‘hžhhŸh¶h Nubj•)”}”(hXFThe driver supports a CPU running in either AArch64 or AArch32 mode. The registers naming convention is a bit different between them, AArch64 uses 'ED' for register prefix (ARM DDI 0487A.k, chapter H9.1) and AArch32 uses 'DBG' as prefix (ARM DDI 0487A.k, chapter G5.1). The driver is unified to use AArch64 naming convention. ”h]”hÞ)”}”(hXEThe driver supports a CPU running in either AArch64 or AArch32 mode. The registers naming convention is a bit different between them, AArch64 uses 'ED' for register prefix (ARM DDI 0487A.k, chapter H9.1) and AArch32 uses 'DBG' as prefix (ARM DDI 0487A.k, chapter G5.1). The driver is unified to use AArch64 naming convention.”h]”hXMThe driver supports a CPU running in either AArch64 or AArch32 mode. The registers naming convention is a bit different between them, AArch64 uses ‘ED’ for register prefix (ARM DDI 0487A.k, chapter H9.1) and AArch32 uses ‘DBG’ as prefix (ARM DDI 0487A.k, chapter G5.1). The driver is unified to use AArch64 naming convention.”…””}”(hjÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K+hjÆubah}”(h]”h ]”h"]”h$]”h&]”uh1j”hj‘hžhhŸh¶h Nubj•)”}”(hX•ARMv8-a (ARM DDI 0487A.k) and ARMv7-a (ARM DDI 0406C.b) have different register bits definition. So the driver consolidates two difference: If PCSROffset=0b0000, on ARMv8-a the feature of EDPCSR is not implemented; but ARMv7-a defines "PCSR samples are offset by a value that depends on the instruction set state". For ARMv7-a, the driver checks furthermore if CPU runs with ARM or thumb instruction set and calibrate PCSR value, the detailed description for offset is in ARMv7-a ARM (ARM DDI 0406C.b) chapter C11.11.34 "DBGPCSR, Program Counter Sampling Register". If PCSROffset=0b0010, ARMv8-a defines "EDPCSR implemented, and samples have no offset applied and do not sample the instruction set state in AArch32 state". So on ARMv8 if EDDEVID1.PCSROffset is 0b0010 and the CPU operates in AArch32 state, EDPCSR is not sampled; when the CPU operates in AArch64 state EDPCSR is sampled and no offset are applied. ”h]”(hÞ)”}”(hŒ‹ARMv8-a (ARM DDI 0487A.k) and ARMv7-a (ARM DDI 0406C.b) have different register bits definition. So the driver consolidates two difference:”h]”hŒ‹ARMv8-a (ARM DDI 0487A.k) and ARMv7-a (ARM DDI 0406C.b) have different register bits definition. So the driver consolidates two difference:”…””}”(hjâhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K1hjÞubhÞ)”}”(hX©If PCSROffset=0b0000, on ARMv8-a the feature of EDPCSR is not implemented; but ARMv7-a defines "PCSR samples are offset by a value that depends on the instruction set state". For ARMv7-a, the driver checks furthermore if CPU runs with ARM or thumb instruction set and calibrate PCSR value, the detailed description for offset is in ARMv7-a ARM (ARM DDI 0406C.b) chapter C11.11.34 "DBGPCSR, Program Counter Sampling Register".”h]”hX±If PCSROffset=0b0000, on ARMv8-a the feature of EDPCSR is not implemented; but ARMv7-a defines “PCSR samples are offset by a value that depends on the instruction set stateâ€. For ARMv7-a, the driver checks furthermore if CPU runs with ARM or thumb instruction set and calibrate PCSR value, the detailed description for offset is in ARMv7-a ARM (ARM DDI 0406C.b) chapter C11.11.34 “DBGPCSR, Program Counter Sampling Registerâ€.”…””}”(hjðhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K4hjÞubhÞ)”}”(hX[If PCSROffset=0b0010, ARMv8-a defines "EDPCSR implemented, and samples have no offset applied and do not sample the instruction set state in AArch32 state". So on ARMv8 if EDDEVID1.PCSROffset is 0b0010 and the CPU operates in AArch32 state, EDPCSR is not sampled; when the CPU operates in AArch64 state EDPCSR is sampled and no offset are applied.”h]”hX_If PCSROffset=0b0010, ARMv8-a defines “EDPCSR implemented, and samples have no offset applied and do not sample the instruction set state in AArch32 stateâ€. So on ARMv8 if EDDEVID1.PCSROffset is 0b0010 and the CPU operates in AArch32 state, EDPCSR is not sampled; when the CPU operates in AArch64 state EDPCSR is sampled and no offset are applied.”…””}”(hjþhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K;hjÞubeh}”(h]”h ]”h"]”h$]”h&]”uh1j”hj‘hžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jhŸh¶h Khj~hžhubeh}”(h]”Œimplementation”ah ]”h"]”Œimplementation”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒClock and power domain”h]”hŒClock and power domain”…””}”(hj%hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj"hžhhŸh¶h KCubhÞ)”}”(hXBefore accessing debug registers, we should ensure the clock and power domain have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter 'H9.1 Debug registers', the debug registers are spread into two domains: the debug domain and the CPU domain. ::”h]”hXBefore accessing debug registers, we should ensure the clock and power domain have been enabled properly. In ARMv8-a ARM (ARM DDI 0487A.k) chapter ‘H9.1 Debug registers’, the debug registers are spread into two domains: the debug domain and the CPU domain.”…””}”(hj3hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KEhj"hžhubhŒ literal_block”“”)”}”(hX; +---------------+ | | | | +----------+--+ | dbg_clock -->| |**| |<-- cpu_clock | Debug |**| CPU | dbg_power_domain -->| |**| |<-- cpu_power_domain +----------+--+ | | | | | +---------------+”h]”hX; +---------------+ | | | | +----------+--+ | dbg_clock -->| |**| |<-- cpu_clock | Debug |**| CPU | dbg_power_domain -->| |**| |<-- cpu_power_domain +----------+--+ | | | | | +---------------+”…””}”hjCsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jAhŸh¶h KKhj"hžhubhÞ)”}”(hŒøFor debug domain, the user uses DT binding "clocks" and "power-domains" to specify the corresponding clock source and power supply for the debug logic. The driver calls the pm_runtime_{put|get} operations as needed to handle the debug power domain.”h]”hXFor debug domain, the user uses DT binding “clocks†and “power-domains†to specify the corresponding clock source and power supply for the debug logic. The driver calls the pm_runtime_{put|get} operations as needed to handle the debug power domain.”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KWhj"hžhubhÞ)”}”(hŒ¬For CPU domain, the different SoC designs have different power management schemes and finally this heavily impacts external debug module. So we can divide into below cases:”h]”hŒ¬For CPU domain, the different SoC designs have different power management schemes and finally this heavily impacts external debug module. So we can divide into below cases:”…””}”(hjahžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K\hj"hžhubj)”}”(hhh]”(j•)”}”(hX±On systems with a sane power controller which can behave correctly with respect to CPU power domain, the CPU power domain can be controlled by register EDPRCR in driver. The driver firstly writes bit EDPRCR.COREPURQ to power up the CPU, and then writes bit EDPRCR.CORENPDRQ for emulation of CPU power down. As result, this can ensure the CPU power domain is powered on properly during the period when access debug related registers; ”h]”hÞ)”}”(hX°On systems with a sane power controller which can behave correctly with respect to CPU power domain, the CPU power domain can be controlled by register EDPRCR in driver. The driver firstly writes bit EDPRCR.COREPURQ to power up the CPU, and then writes bit EDPRCR.CORENPDRQ for emulation of CPU power down. As result, this can ensure the CPU power domain is powered on properly during the period when access debug related registers;”h]”hX°On systems with a sane power controller which can behave correctly with respect to CPU power domain, the CPU power domain can be controlled by register EDPRCR in driver. The driver firstly writes bit EDPRCR.COREPURQ to power up the CPU, and then writes bit EDPRCR.CORENPDRQ for emulation of CPU power down. As result, this can ensure the CPU power domain is powered on properly during the period when access debug related registers;”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K`hjrubah}”(h]”h ]”h"]”h$]”h&]”uh1j”hjohžhhŸh¶h Nubj•)”}”(hXíSome designs will power down an entire cluster if all CPUs on the cluster are powered down - including the parts of the debug registers that should remain powered in the debug power domain. The bits in EDPRCR are not respected in these cases, so these designs do not support debug over power down in the way that the CoreSight / Debug designers anticipated. This means that even checking EDPRSR has the potential to cause a bus hang if the target register is unpowered. In this case, accessing to the debug registers while they are not powered is a recipe for disaster; so we need preventing CPU low power states at boot time or when user enable module at the run time. Please see chapter "How to use the module" for detailed usage info for this. ”h]”(hÞ)”}”(hXÕSome designs will power down an entire cluster if all CPUs on the cluster are powered down - including the parts of the debug registers that should remain powered in the debug power domain. The bits in EDPRCR are not respected in these cases, so these designs do not support debug over power down in the way that the CoreSight / Debug designers anticipated. This means that even checking EDPRSR has the potential to cause a bus hang if the target register is unpowered.”h]”hXÕSome designs will power down an entire cluster if all CPUs on the cluster are powered down - including the parts of the debug registers that should remain powered in the debug power domain. The bits in EDPRCR are not respected in these cases, so these designs do not support debug over power down in the way that the CoreSight / Debug designers anticipated. This means that even checking EDPRSR has the potential to cause a bus hang if the target register is unpowered.”…””}”(hjŽhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KghjŠubhÞ)”}”(hXIn this case, accessing to the debug registers while they are not powered is a recipe for disaster; so we need preventing CPU low power states at boot time or when user enable module at the run time. Please see chapter "How to use the module" for detailed usage info for this.”h]”hXIn this case, accessing to the debug registers while they are not powered is a recipe for disaster; so we need preventing CPU low power states at boot time or when user enable module at the run time. Please see chapter “How to use the module†for detailed usage info for this.”…””}”(hjœhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KohjŠubeh}”(h]”h ]”h"]”h$]”h&]”uh1j”hjohžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jjuh1jhŸh¶h K`hj"hžhubeh}”(h]”Œclock-and-power-domain”ah ]”h"]”Œclock and power domain”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KCubh¢)”}”(hhh]”(h§)”}”(hŒDevice Tree Bindings”h]”hŒDevice Tree Bindings”…””}”(hjÁhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj¾hžhhŸh¶h KvubhÞ)”}”(hŒSSee Documentation/devicetree/bindings/arm/arm,coresight-cpu-debug.yaml for details.”h]”hŒSSee Documentation/devicetree/bindings/arm/arm,coresight-cpu-debug.yaml for details.”…””}”(hjÏhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h Kxhj¾hžhubeh}”(h]”Œdevice-tree-bindings”ah ]”h"]”Œdevice tree bindings”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kvubh¢)”}”(hhh]”(h§)”}”(hŒHow to use the module”h]”hŒHow to use the module”…””}”(hjèhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjåhžhhŸh¶h K}ubhÞ)”}”(hŒŒIf you want to enable debugging functionality at boot time, you can add "coresight_cpu_debug.enable=1" to the kernel command line parameter.”h]”hŒIf you want to enable debugging functionality at boot time, you can add “coresight_cpu_debug.enable=1†to the kernel command line parameter.”…””}”(hjöhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KhjåhžhubhÞ)”}”(hŒTThe driver also can work as module, so can enable the debugging when insmod module::”h]”hŒSThe driver also can work as module, so can enable the debugging when insmod module:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K‚hjåhžhubjB)”}”(hŒ'# insmod coresight_cpu_debug.ko debug=1”h]”hŒ'# insmod coresight_cpu_debug.ko debug=1”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h K…hjåhžhubhÞ)”}”(hŒ©When boot time or insmod module you have not enabled the debugging, the driver uses the debugfs file system to provide a knob to dynamically enable or disable debugging:”h]”hŒ©When boot time or insmod module you have not enabled the debugging, the driver uses the debugfs file system to provide a knob to dynamically enable or disable debugging:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K‡hjåhžhubhÞ)”}”(hŒMTo enable it, write a '1' into /sys/kernel/debug/coresight_cpu_debug/enable::”h]”hŒPTo enable it, write a ‘1’ into /sys/kernel/debug/coresight_cpu_debug/enable:”…””}”(hj.hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K‹hjåhžhubjB)”}”(hŒ7# echo 1 > /sys/kernel/debug/coresight_cpu_debug/enable”h]”hŒ7# echo 1 > /sys/kernel/debug/coresight_cpu_debug/enable”…””}”hj<sbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h KhjåhžhubhÞ)”}”(hŒNTo disable it, write a '0' into /sys/kernel/debug/coresight_cpu_debug/enable::”h]”hŒQTo disable it, write a ‘0’ into /sys/kernel/debug/coresight_cpu_debug/enable:”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KhjåhžhubjB)”}”(hŒ7# echo 0 > /sys/kernel/debug/coresight_cpu_debug/enable”h]”hŒ7# echo 0 > /sys/kernel/debug/coresight_cpu_debug/enable”…””}”hjXsbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h K‘hjåhžhubhÞ)”}”(hXNAs explained in chapter "Clock and power domain", if you are working on one platform which has idle states to power off debug logic and the power controller cannot work well for the request from EDPRCR, then you should firstly constraint CPU idle states before enable CPU debugging feature; so can ensure the accessing to debug logic.”h]”hXRAs explained in chapter “Clock and power domainâ€, if you are working on one platform which has idle states to power off debug logic and the power controller cannot work well for the request from EDPRCR, then you should firstly constraint CPU idle states before enable CPU debugging feature; so can ensure the accessing to debug logic.”…””}”(hjfhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K“hjåhžhubhÞ)”}”(hŒqIf you want to limit idle states at boot time, you can use "nohlt" or "cpuidle.off=1" in the kernel command line.”h]”hŒyIf you want to limit idle states at boot time, you can use “nohlt†or “cpuidle.off=1†in the kernel command line.”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K™hjåhžhubhÞ)”}”(hŒ>At the runtime you can disable idle states with below methods:”h]”hŒ>At the runtime you can disable idle states with below methods:”…””}”(hj‚hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KœhjåhžhubhÞ)”}”(hXUIt is possible to disable CPU idle states by way of the PM QoS subsystem, more specifically by using the "/dev/cpu_dma_latency" interface (see Documentation/power/pm_qos_interface.rst for more details). As specified in the PM QoS documentation the requested parameter will stay in effect until the file descriptor is released. For example::”h]”hXXIt is possible to disable CPU idle states by way of the PM QoS subsystem, more specifically by using the “/dev/cpu_dma_latency†interface (see Documentation/power/pm_qos_interface.rst for more details). As specified in the PM QoS documentation the requested parameter will stay in effect until the file descriptor is released. For example:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KžhjåhžhubjB)”}”(hŒO# exec 3<> /dev/cpu_dma_latency; echo 0 >&3 ... Do some work... ... # exec 3<>-”h]”hŒO# exec 3<> /dev/cpu_dma_latency; echo 0 >&3 ... Do some work... ... # exec 3<>-”…””}”hjžsbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h K¥hjåhžhubhÞ)”}”(hŒ6The same can also be done from an application program.”h]”hŒ6The same can also be done from an application program.”…””}”(hj¬hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K«hjåhžhubhÞ)”}”(hŒnDisable specific CPU's specific idle state from cpuidle sysfs (see Documentation/admin-guide/pm/cpuidle.rst)::”h]”hŒoDisable specific CPU’s specific idle state from cpuidle sysfs (see Documentation/admin-guide/pm/cpuidle.rst):”…””}”(hjºhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h K­hjåhžhubjB)”}”(hŒF# echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable”h]”hŒF# echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable”…””}”hjÈsbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h K°hjåhžhubeh}”(h]”Œhow-to-use-the-module”ah ]”h"]”Œhow to use the module”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K}ubh¢)”}”(hhh]”(h§)”}”(hŒ Output format”h]”hŒ Output format”…””}”(hjáhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjÞhžhhŸh¶h K³ubhÞ)”}”(hŒ3Here is an example of the debugging output format::”h]”hŒ2Here is an example of the debugging output format:”…””}”(hjïhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhŸh¶h KµhjÞhžhubjB)”}”(hXËARM external debug module: coresight-cpu-debug 850000.debug: CPU[0]: coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) coresight-cpu-debug 852000.debug: CPU[1]: coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0)”h]”hXËARM external debug module: coresight-cpu-debug 850000.debug: CPU[0]: coresight-cpu-debug 850000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) coresight-cpu-debug 850000.debug: EDPCSR: handle_IPI+0x174/0x1d8 coresight-cpu-debug 850000.debug: EDCIDSR: 00000000 coresight-cpu-debug 850000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0) coresight-cpu-debug 852000.debug: CPU[1]: coresight-cpu-debug 852000.debug: EDPRSR: 00000001 (Power:On DLK:Unlock) coresight-cpu-debug 852000.debug: EDPCSR: debug_notifier_call+0x23c/0x358 coresight-cpu-debug 852000.debug: EDCIDSR: 00000000 coresight-cpu-debug 852000.debug: EDVIDSR: 90000000 (State:Non-secure Mode:EL1/0 Width:64bits VMID:0)”…””}”hjýsbah}”(h]”h ]”h"]”h$]”h&]”jQjRuh1jAhŸh¶h K·hjÞhžhubeh}”(h]”Œ output-format”ah ]”h"]”Œ output format”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K³ubeh}”(h]”Œcoresight-cpu-debug-module”ah ]”h"]”Œcoresight cpu debug module”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j>Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jjj{jxjjj»j¸jâjßjÛjØjj uŒ nametypes”}”(j‰j{‰j‰j»‰jâ‰jÛ‰j‰uh}”(jh£jxjIjj~j¸j"jßj¾jØjåj jÞuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.