CN107832084A - 一种基于龙芯平台的中断扩展方法 - Google Patents

一种基于龙芯平台的中断扩展方法 Download PDF

Info

Publication number
CN107832084A
CN107832084A CN201710928625.8A CN201710928625A CN107832084A CN 107832084 A CN107832084 A CN 107832084A CN 201710928625 A CN201710928625 A CN 201710928625A CN 107832084 A CN107832084 A CN 107832084A
Authority
CN
China
Prior art keywords
interrupt
ioapic
register
expansion method
interruption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710928625.8A
Other languages
English (en)
Other versions
CN107832084B (zh
Inventor
谭健
吴少刚
张福新
孙海勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Aerospace Dragon Dream Information Technology Co Ltd
Original Assignee
Jiangsu Aerospace Dragon Dream Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Aerospace Dragon Dream Information Technology Co Ltd filed Critical Jiangsu Aerospace Dragon Dream Information Technology Co Ltd
Priority to CN201710928625.8A priority Critical patent/CN107832084B/zh
Publication of CN107832084A publication Critical patent/CN107832084A/zh
Application granted granted Critical
Publication of CN107832084B publication Critical patent/CN107832084B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • G06F9/327Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address for interrupts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/24Interrupt
    • G06F2213/2412Dispatching of interrupt load among interrupt handlers in processor system or interrupt controller

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

本发明公开了一种基于龙芯平台的中断扩展方法,依次包括以下步骤:1)设置IOAPIC的基址寄存器,取用于PCIE的内存空间物理地址的高位作为所述基址寄存器的地址;2)启用IOAPIC,设置中断入口数量,使能IOAPIC在产生中断后发送’wake’信号到北桥芯片组的I/O芯片,使能南桥芯片的中断回溯功能;3)配置中断路由寄存器,设置44路中断对应组和14路独立中断对应中断引脚;4)配置重定向入口表,为所述中断引脚设置低位寄存器和用于存放目标地址的高位存储器;5)内核处理龙芯相关中断的文件,增加中断号以及增加中断处理中mask和unmask功能。该中断扩展方法大大扩展了龙芯平台中断数量并缩短了中断路由。

Description

一种基于龙芯平台的中断扩展方法
技术领域
本发明涉及一种中断扩展方法,特别是涉及一种基于龙芯平台的中断扩展方法。
背景技术
中断:CPU在正常执行程序的过程中,由于某个外部或者内部事件的作用,强迫CPU停止当前正在执行的程序,转去为该事务服务(称为中断服务),待服务结束后,又能自动返回到被中断的程序中继续执行。中断控制的优点在于解放CPU,只有当有需要时才服务,且设计了优先级。
PIC(Programmble Interrupt Control)可编程中断控制器,通常指采用兼容8259芯片通过级联,最大产生16根IRQ(Interrupt Request)线,优先级由中断引脚编号决定。
APIC(Advanced Programmble Interrupt Control)高级可编程中断控制器,其有位于芯片组的IOAPIC和位于CPU的Local APIC两部分组成。优先级由软件控制,每一个中断引脚均可单独设置。
目前,龙芯平台采用兼容8259A芯片的传统PIC中断方式,扣除系统保留的中断号,能用于外扩设备的中断号仅有3个;且中断控制器位于南桥,北桥设备需经过长距离路由才能被CPU响应处理。
发明内容
本发明的目的是提供一种基于龙芯平台的中断扩展方法,解决现有中断方案可用中断数量少以及北桥设备中断路径过长的问题。
本发明技术方案如下:一种基于龙芯平台的中断扩展方法,依次包括以下步骤:
1)设置IOAPIC的基址寄存器,取用于PCIE的内存空间物理地址的高位作为所述基址寄存器的地址;
2)启用IOAPIC,设置中断入口数量,使能IOAPIC在产生中断后发送’wake’信号到北桥芯片组的I/O芯片,使能南桥芯片的中断回溯功能;
3)配置中断路由寄存器,设置44路中断对应组和14路独立中断对应中断引脚;
4)配置重定向入口表,为所述中断引脚设置低位寄存器和用于存放目标地址的高位存储器;
5)内核处理龙芯相关中断的文件,增加中断号以及增加中断处理中mask和unmask功能。
优选的,所述中断入口数量为32或者24。
优选的,所述低位寄存器包括目标地址和触发方式。
优选的,所述步骤5)增加中断号为增加数组ht_irq的数值,所述数组ht_irq的数值与中断入口数量相等。
与现有技术相比,本发明技术方案的优点在于:传统扩展中断数量的方法是级联多片中断控制器,这就带来额外的成本且无法兼容先前设计的板卡,本发明在不改动硬件方案的基础上,通过IOAPIC方式来解决此问题,减少成本的同时兼容了所有板卡。本发明将原先16个中断数量增加至256个,大大扩张了中断数量,同时北桥芯片组无需回溯到南桥,直接将中断信号路由至CPU,缩短中断路由。
附图说明
图1为本发明方法扩展中断后中断处理路径示意图。
图2位现有技术中断处理路径示意图。
具体实施方式
下面结合实施例对本发明作进一步说明,但不作为对本发明的限定。
本发明所采用的硬件方案是龙芯3A2000CPU+SR5690芯片组,基于该平台的中断方法依次包括如下几个步骤
1)设置IOAPIC的基址寄存器Bar Address Register(BAR)
i.根据《龙芯CPU开发系统固件与内核接口规范》,物理地址0x4000_0000~0x7FFF_FFFF用于PCIE的内存空间,取此地址空间的高位,即0x7FEC_0000作为基址寄存器的地址;
2)设置IOAPIC属性
i.启用IOAPIC;
ii.设置中断入口数量,可选32或者24;
iii.使能IOAPIC在产生中断后发送’wake’信号到北桥芯片组的I/O芯片(I/OControl),该动作在设置完成后由硬件自动执行;
iv.使能南桥中断回溯功能;
3)配置中断路由寄存器,包括中断组和独立中断引脚,通过北桥寄存器对(0xF8,0xFC)访问配置寄存器进行设置寄存器组0x03~0x09
i.设置44路中断对应组;
ii.设置14路独立中断对应中断引脚;
4)配置重定向入口表(RTE Redirection Table Entry),通过步骤(1)中设置的寄存器基地址,加上各个节点的偏移地址(0x10~0x4F)进行访问控制
i:为32/24个中断引脚设置低位寄存器,包括目标地址、触发方式等;
ii:为32/24个中断引脚设置高位寄存器,用于存放目标地址;
5)扩展内核中断处理,内核处理龙芯相关中断的文件,目录结构arch/mips/loongson64/loongson-3/rs780-irq.c
i.增加中断号,主要增加数组ht_irq的数值,最多处理32个中断源;
ii.增加中断处理中mask和unmask功能。
采用本方法进行中断扩展,中断产生后其执行流程如图1所示:
1)北桥200所接设备400产生的中断路由至内部APIC为路径1a,由IOMMU重映射后直接交给CPU 100为路径2a;
2)南桥300所接设备产生的中断首先通过北桥200为路径2a,然后发出中断消息给CPU 100处理为路径2b。
而采用现有技术PIC方式,中断产生后其执行流程如图2所示:
1)北桥200所接设备400产生的中断首先交给位于南桥300的PIC控制器为路径1c和2c,然后交给北桥200的PCIE complex为路径3c,最后由CPU 100处理为路径4c
2)南桥300所接设备产生的中断首先通过北桥200为路径1d,然后发出中断消息给CPU100处理为路径2d。

Claims (4)

1.一种基于龙芯平台的中断扩展方法,其特征在于,依次包括以下步骤:
1)设置IOAPIC的基址寄存器,取用于PCIE的内存空间物理地址的高位作为所述基址寄存器的地址;
2)启用IOAPIC,设置中断入口数量,使能IOAPIC在产生中断后发送’wake’信号到北桥芯片组的I/O芯片,使能南桥芯片的中断回溯功能;
3)配置中断路由寄存器,设置44路中断对应组和14路独立中断对应中断引脚;
4)配置重定向入口表,为所述中断引脚设置低位寄存器和用于存放目标地址的高位存储器;
5)内核处理龙芯相关中断的文件,增加中断号以及增加中断处理中mask和unmask功能。
2.根据权利要求1所述的基于龙芯平台的中断扩展方法,其特征在于,所述中断入口数量为32或者24。
3.根据权利要求1所述的基于龙芯平台的中断扩展方法,其特征在于,所述低位寄存器包括目标地址和触发方式。
4.根据权利要求1所述的基于龙芯平台的中断扩展方法,其特征在于,所述步骤5)增加中断号为增加数组ht_irq的数值,所述数组ht_irq的数值与中断入口数量相等。
CN201710928625.8A 2017-10-09 2017-10-09 一种基于龙芯平台的中断扩展方法 Active CN107832084B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710928625.8A CN107832084B (zh) 2017-10-09 2017-10-09 一种基于龙芯平台的中断扩展方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710928625.8A CN107832084B (zh) 2017-10-09 2017-10-09 一种基于龙芯平台的中断扩展方法

Publications (2)

Publication Number Publication Date
CN107832084A true CN107832084A (zh) 2018-03-23
CN107832084B CN107832084B (zh) 2021-06-29

Family

ID=61647891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710928625.8A Active CN107832084B (zh) 2017-10-09 2017-10-09 一种基于龙芯平台的中断扩展方法

Country Status (1)

Country Link
CN (1) CN107832084B (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909639A (zh) * 2023-09-13 2023-10-20 珠海星云智联科技有限公司 一种挂载系统、方法、集群以及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909639A (zh) * 2023-09-13 2023-10-20 珠海星云智联科技有限公司 一种挂载系统、方法、集群以及存储介质
CN116909639B (zh) * 2023-09-13 2023-12-12 珠海星云智联科技有限公司 一种挂载系统、方法、集群以及存储介质

Also Published As

Publication number Publication date
CN107832084B (zh) 2021-06-29

Similar Documents

Publication Publication Date Title
CN102184122B (zh) 一种龙芯CPU主板bios及中断的实现方法
US9632557B2 (en) Active state power management (ASPM) to reduce power consumption by PCI express components
US9043521B2 (en) Technique for communicating interrupts in a computer system
CN102231142A (zh) 一种带有仲裁器的多通道dma控制器
CN104021109B (zh) 用于在计算机系统中传递中断的技术
US20020178320A1 (en) Method and architecture for accessing hardware devices in computer system and the chipset thereof
CN102622320B (zh) 用于飞腾服务器的中断控制方法
US20090307408A1 (en) Peer-to-Peer Embedded System Communication Method and Apparatus
US10545894B2 (en) Information processor with tightly coupled smart memory unit
JP2008204456A (ja) 複雑な非線形データの転送制御システム
CN103003808A (zh) 用于访问PCI Express 兼容设备的资源的系统和方法
WO2016069176A1 (en) Methods and circuits for deadlock avoidance
JP2010128696A (ja) バスブリッジ装置およびそれを用いたバスブリッジシステム
CN107832084A (zh) 一种基于龙芯平台的中断扩展方法
KR900004291B1 (ko) 데이터 프로세서
TWI720345B (zh) 多核心系統的內連線結構
US5305442A (en) Generalized hierarchical architecture for bus adapters
CN102063337B (zh) 多处理器核的信息交互和资源分配的方法及系统
US20130166805A1 (en) Interrupt cause management device and interrupt processing system
US7926013B2 (en) Validating continuous signal phase matching in high-speed nets routed as differential pairs
US7516260B2 (en) Method of communicating with embedded controller
CN103049409B (zh) 一种单向高速数据传输的控制方法
US9176554B2 (en) Power management in a bridge based on a second derivative value derived from a mathematical derivative of plurality of values corresponding to the received packets
JPWO2012124431A1 (ja) 半導体装置
US7243178B2 (en) Enable/disable claiming of a DMA request interrupt

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant