Skip to content

Conversation

@lyt31
Copy link
Contributor

@lyt31 lyt31 commented May 20, 2024

This patch documents the DT binding for the Phytium lpc-snoop driver.

The LPC snoop driver is used to monitor the startup progress of the CPU
side Server. Generally,port 0x80 is used.

The usage is as follows: The firmware writes the current system
startup progress to port 0x80 during the server CPU side startup,
and then the system has an APP program to obtain the data on port
0x80 from the snoop and output it to the terminal.

lyt31 added 2 commits May 20, 2024 10:21
This patch documents the DT binding for the Phytium lpc-snoop driver.

Signed-off-by: Li Yuting <liyuting2071@phytium.com.cn>
Signed-off-by: Lan Hengyu <lanhengyu1395@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
The LPC snoop driver is used to monitor the startup progress of the CPU
side Server. Generally,port 0x80 is used.

The usage is as follows: The firmware writes the current system
startup progress to port 0x80 during the server CPU side startup,
and then the system has an APP program to obtain the data on port
0x80 from the snoop and output it to the terminal.

Signed-off-by: Li Yuting <liyuting2071@phytium.com.cn>
Signed-off-by: Lan Hengyu <lanhengyu1395@phytium.com.cn>
Signed-off-by: Wang Yinfeng <wangyinfeng@phytium.com.cn>
@deepin-ci-robot deepin-ci-robot requested a review from BLumia May 20, 2024 02:28
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign liujianqiang-niu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

Hi @lyt31. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

snp_addr_reg_shift = snp_addr_reg_snp2_shift;
break;
default:
return -EINVAL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审核意见:phytium_lpc_enable_snoop传入channel都是 0或1时是正常的 如果调用者传递的channel不是 0或1此处没有调用kfifo_free

@opsiff
Copy link
Member

opsiff commented Jun 25, 2024

/ok-to-test

@opsiff opsiff merged commit 9b58da7 into deepin-community:linux-6.6.y Jun 25, 2024
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • phytium_lpc_snoop_probe函数中,of_property_read_u32_index函数调用可能需要检查返回值以确保正确读取snoop-ports属性。
  • phytium_lpc_snoop_config_irq函数中,regmap_write操作可能需要检查写入操作是否成功。
  • phytium_lpc_enable_snoop函数中,misc_register操作可能需要检查注册操作是否成功。
  • phytium_lpc_disable_snoop函数中,注释掉的代码/* ... */应该被删除,以保持代码的整洁。
  • phytium_lpc_snoop_irq函数中,regmap_update_bits操作可能需要检查更新操作是否成功。
  • put_fifo_with_discard函数中,注释掉的代码/* ... */应该被删除,以保持代码的整洁。
  • 全局变量snp_enable_reg_ensnp_addr_reg_masksnp_addr_reg_shift等在phytium_lpc_snoop_irq函数中使用,但没有看到相应的定义和初始化过程,这可能是一个遗漏。
  • phytium_lpc_snoop_config_irq函数中的snp_enable_reg_en变量应该定义为u32类型,而不是u8类型。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_mask变量应该定义为u32类型,而不是u16类型。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_shift变量应该定义为u32类型,而不是u8类型。
  • phytium_lpc_snoop_config_irq函数中的snp_enable_reg_en变量应该初始化为0,而不是(snp_enable_reg_snp1_en | snp_enable_reg_snp1_int_en)
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_mask变量应该初始化为snp_addr_reg_snp1_addr,而不是snp_addr_reg_snp2_addr
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_shift变量应该初始化为snp_addr_reg_snp1_shift,而不是snp_addr_reg_snp2_shift
  • phytium_lpc_snoop_config_irq函数中的snp_enable_reg_en变量应该重新命名为snp_enable_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_mask变量应该重新命名为snp_addr_reg_mask_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_shift变量应该重新命名为snp_addr_reg_shift_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_enable_reg_en变量应该重新命名为snp_enable_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_mask变量应该重新命名为snp_addr_reg_mask_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_addr_reg_shift变量应该重新命名为snp_addr_reg_shift_bits,以更清晰地表示其用途。
  • phytium_lpc_snoop_config_irq函数中的snp_enable_reg_en变量应该

opsiff added a commit to opsiff/UOS-kernel that referenced this pull request Dec 29, 2025
Per last commit, change phytium irq-gic-phytium-2500.c:
	From 18fdb63 Mon Sep 17 00:00:00 2001
	From: Mark Rutland <mark.rutland@arm.com>
	Date: Mon, 17 Jun 2024 12:18:41 +0100
	Subject: [PATCH] arm64: irqchip/gic-v3: Select priorities at boot time

	The distributor and PMR/RPR can present different views of the interrupt
	priority space dependent upon the values of GICD_CTLR.DS and
	SCR_EL3.FIQ. Currently we treat the distributor's view of the priority
	space as canonical, and when the two differ we change the way we handle
	values in the PMR/RPR, using the `gic_nonsecure_priorities` static key
	to decide what to do.

	This approach works, but it's sub-optimal. When using pseudo-NMI we
	manipulate the distributor rarely, and we manipulate the PMR/RPR
	registers very frequently in code spread out throughout the kernel (e.g.
	local_irq_{save,restore}()). It would be nicer if we could use fixed
	values for the PMR/RPR, and dynamically choose the values programmed
	into the distributor.

	This patch changes the GICv3 driver and arm64 code accordingly. PMR
	values are chosen at compile time, and the GICv3 driver determines the
	appropriate values to program into the distributor at boot time. This
	removes the need for the `gic_nonsecure_priorities` static key and
	results in smaller and better generated code for saving/restoring the
	irqflags.

	Before this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d503201f        nop
	|   10:   d2800c00        mov     x0, #0x60                       // deepin-community#96
	|   14:   d5184600        msr     icc_pmr_el1, x0
	|   18:   d65f03c0        ret
	|   1c:   d2801400        mov     x0, #0xa0                       // deepin-community#160
	|   20:   17fffffd        b       14 <outlined_local_irq_disable+0x14>

	After this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d2801800        mov     x0, #0xc0                       // deepin-community#192
	|   10:   d5184600        msr     icc_pmr_el1, x0
	|   14:   d65f03c0        ret

	... with 3 fewer instructions per call.

	For defconfig + CONFIG_PSEUDO_NMI=y, this results in a minor saving of
	~4K of text, and will make it easier to make further improvements to the
	way we manipulate irqflags and DAIF bits.

	Signed-off-by: Mark Rutland <mark.rutland@arm.com>
	Cc: Alexandru Elisei <alexandru.elisei@arm.com>
	Cc: Marc Zyngier <maz@kernel.org>
	Cc: Thomas Gleixner <tglx@linutronix.de>
	Cc: Will Deacon <will@kernel.org>
	Reviewed-by: Marc Zyngier <maz@kernel.org>
	Tested-by: Marc Zyngier <maz@kernel.org>
	Link: https://lore.kernel.org/r/20240617111841.2529370-6-mark.rutland@arm.com
	Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
	Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
opsiff added a commit to opsiff/UOS-kernel that referenced this pull request Dec 29, 2025
Per last commit, change phytium irq-gic-phytium-2500.c:
	From 18fdb63 Mon Sep 17 00:00:00 2001
	From: Mark Rutland <mark.rutland@arm.com>
	Date: Mon, 17 Jun 2024 12:18:41 +0100
	Subject: [PATCH] arm64: irqchip/gic-v3: Select priorities at boot time

	The distributor and PMR/RPR can present different views of the interrupt
	priority space dependent upon the values of GICD_CTLR.DS and
	SCR_EL3.FIQ. Currently we treat the distributor's view of the priority
	space as canonical, and when the two differ we change the way we handle
	values in the PMR/RPR, using the `gic_nonsecure_priorities` static key
	to decide what to do.

	This approach works, but it's sub-optimal. When using pseudo-NMI we
	manipulate the distributor rarely, and we manipulate the PMR/RPR
	registers very frequently in code spread out throughout the kernel (e.g.
	local_irq_{save,restore}()). It would be nicer if we could use fixed
	values for the PMR/RPR, and dynamically choose the values programmed
	into the distributor.

	This patch changes the GICv3 driver and arm64 code accordingly. PMR
	values are chosen at compile time, and the GICv3 driver determines the
	appropriate values to program into the distributor at boot time. This
	removes the need for the `gic_nonsecure_priorities` static key and
	results in smaller and better generated code for saving/restoring the
	irqflags.

	Before this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d503201f        nop
	|   10:   d2800c00        mov     x0, #0x60                       // deepin-community#96
	|   14:   d5184600        msr     icc_pmr_el1, x0
	|   18:   d65f03c0        ret
	|   1c:   d2801400        mov     x0, #0xa0                       // deepin-community#160
	|   20:   17fffffd        b       14 <outlined_local_irq_disable+0x14>

	After this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d2801800        mov     x0, #0xc0                       // deepin-community#192
	|   10:   d5184600        msr     icc_pmr_el1, x0
	|   14:   d65f03c0        ret

	... with 3 fewer instructions per call.

	For defconfig + CONFIG_PSEUDO_NMI=y, this results in a minor saving of
	~4K of text, and will make it easier to make further improvements to the
	way we manipulate irqflags and DAIF bits.

	Signed-off-by: Mark Rutland <mark.rutland@arm.com>
	Cc: Alexandru Elisei <alexandru.elisei@arm.com>
	Cc: Marc Zyngier <maz@kernel.org>
	Cc: Thomas Gleixner <tglx@linutronix.de>
	Cc: Will Deacon <will@kernel.org>
	Reviewed-by: Marc Zyngier <maz@kernel.org>
	Tested-by: Marc Zyngier <maz@kernel.org>
	Link: https://lore.kernel.org/r/20240617111841.2529370-6-mark.rutland@arm.com
	Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
	Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
lanlanxiyiji pushed a commit that referenced this pull request Jan 4, 2026
Per last commit, change phytium irq-gic-phytium-2500.c:
	From 18fdb63 Mon Sep 17 00:00:00 2001
	From: Mark Rutland <mark.rutland@arm.com>
	Date: Mon, 17 Jun 2024 12:18:41 +0100
	Subject: [PATCH] arm64: irqchip/gic-v3: Select priorities at boot time

	The distributor and PMR/RPR can present different views of the interrupt
	priority space dependent upon the values of GICD_CTLR.DS and
	SCR_EL3.FIQ. Currently we treat the distributor's view of the priority
	space as canonical, and when the two differ we change the way we handle
	values in the PMR/RPR, using the `gic_nonsecure_priorities` static key
	to decide what to do.

	This approach works, but it's sub-optimal. When using pseudo-NMI we
	manipulate the distributor rarely, and we manipulate the PMR/RPR
	registers very frequently in code spread out throughout the kernel (e.g.
	local_irq_{save,restore}()). It would be nicer if we could use fixed
	values for the PMR/RPR, and dynamically choose the values programmed
	into the distributor.

	This patch changes the GICv3 driver and arm64 code accordingly. PMR
	values are chosen at compile time, and the GICv3 driver determines the
	appropriate values to program into the distributor at boot time. This
	removes the need for the `gic_nonsecure_priorities` static key and
	results in smaller and better generated code for saving/restoring the
	irqflags.

	Before this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d503201f        nop
	|   10:   d2800c00        mov     x0, #0x60                       // #96
	|   14:   d5184600        msr     icc_pmr_el1, x0
	|   18:   d65f03c0        ret
	|   1c:   d2801400        mov     x0, #0xa0                       // #160
	|   20:   17fffffd        b       14 <outlined_local_irq_disable+0x14>

	After this patch, local_irq_disable() compiles to:

	| 0000000000000000 <outlined_local_irq_disable>:
	|    0:   d503201f        nop
	|    4:   d50343df        msr     daifset, #0x3
	|    8:   d65f03c0        ret
	|    c:   d2801800        mov     x0, #0xc0                       // #192
	|   10:   d5184600        msr     icc_pmr_el1, x0
	|   14:   d65f03c0        ret

	... with 3 fewer instructions per call.

	For defconfig + CONFIG_PSEUDO_NMI=y, this results in a minor saving of
	~4K of text, and will make it easier to make further improvements to the
	way we manipulate irqflags and DAIF bits.

	Signed-off-by: Mark Rutland <mark.rutland@arm.com>
	Cc: Alexandru Elisei <alexandru.elisei@arm.com>
	Cc: Marc Zyngier <maz@kernel.org>
	Cc: Thomas Gleixner <tglx@linutronix.de>
	Cc: Will Deacon <will@kernel.org>
	Reviewed-by: Marc Zyngier <maz@kernel.org>
	Tested-by: Marc Zyngier <maz@kernel.org>
	Link: https://lore.kernel.org/r/20240617111841.2529370-6-mark.rutland@arm.com
	Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
	Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants