EC Required Knowledge - LPC
EC Required Knowledge
The first step for a software engineer is to thoroughly understand the relevant specifications, just as understanding the requirements is essential before developing software. Similarly, an EC engineer needs to have a clear understanding of LPC, SMBUS, PS2, and Smart Battery before moving on to the next step.
LPC Specification
This chapter focuses on the LPC Interface, allowing readers to understand its operating principles and pin functions. Understanding the LPC Interface is essential to finding solutions when problems arise.
LPC characteristics
X-BUS interface compatible with legacy systems
It can be addressed up to 4GB, and the BIOS is not limited to 1MB, nor is the memory device limited to 16MB.
It can operate correctly without the need for special driver installation on the operating system.
If I/O or MEMORY instructions take a long time, consider using LPC to enter a wait state.
LPC-supported devices
SUPER I/O – Floppy disk control interface, IR, KBC
Audio – AC97
Memory device – BIOS Flash
System Manager Controller
LPC block diagram
The system's instructions are transmitted from the CPU to the HOST-Bridge (Northbridge chip), then via the PCI Bus to the PCI-Bridge (Southbridge chip), which is also the HOST in the diagram above. The HOST then translates the PCI instructions into LPC instructions and transmits them to the LPC device, thus completing the instruction transfer.
LPC hardware pinout
LPC Transmission Protocol
LPC的指令可分為Memory Read / Write、I/O Read / Write、DMA Read / Write、BUS Master Memory Read / Write及BUS Master I/O Read / Write等如Table 3。
All these diverse instructions are transmitted to the LPC device via a combination of four instruction lines. Therefore, each instruction takes several clock cycles to complete. The time from the start to the completion of an LPC instruction is called an instruction cycle. (See Figure 2)
An LPC instruction cycle includes START, CYCTYPE, ADDR, TAR, SYNC, DATA, and TAR.
Description of the START field –
The PCI cycle indicator field usually needs to be used in conjunction with the cycle type to understand the function of the PCI cycle, except for firmware read/write, which can be directly determined from the Start field.
CYCLE TYPE field description
SIZE field description
SYNC's field description
Introduction to each instruction period
ST - Start Nibble.
TP – Type Nibble.
AD/SZ – Address Nibble or Size Nibble
Firmware Memory Transfer Protocol
Firmware Memory only has memory read and write functions. The main difference between Firmware Memory and LPC memory read and write functions is that Firmware Memory's read and write functions have been expanded from 1, 2, 4, 8 to 16, 128 bits, and the IDSEL field can be used to select which device to read and write memory to.
Firmware Memory Cycle –
The Firmware Memory field –
START field –
IDSEL field – BIT[3:0] Select device
MADDR field – Read position
MSIZE field - Read number of bits
Firmware Memory Read Cycle –
Firmware Memory Write Cycle –
Serial IRQ transmission protocol
Serial IRQ Working Mode
Quiet (Active Mode) When an IRQ occurs, the device only needs to issue an IRQ (pull the signal low) to enter Tri-State. This is more power-efficient. However, some chipsets or EC microprocessors take longer to return to Active from Tri-State, which can cause IRQ misses.
Continuous (Idle Mode) When an IRQ occurs, the device needs to send an IRQ (low-signal) and continuously sample a stop frame until the host device confirms receipt; otherwise, it needs to continuously send IRQs to the host device.
Hi 感謝你對LPC詳細的介紹
回覆刪除我對LPC的控制碰到一些問題,想請教一下
關於LPC的 Memory Read / Write 是不是如同pcie的Memory Read / Write一樣?
我目前的架構是從 Intel CPU 透過 PCI 和 LPC interface 連接到Altera FPGA
目前我可以透過lspci 找到FPGA 的base address+offset即可讀寫FPGA的位址
我一樣可以透過lspci 找到LPC的interface
但是卻看不到 LPC 的base address
log 如下:
root@genericx86-64:/# lspci -s 00:1f.0
00:1f.0 ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard SKU LPC Controller (rev 05)
root@genericx86-64:/# lspci -s 00:1f.0 -vv
00:1f.0 ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard SKU LPC Controller (rev 05)
Subsystem: Intel Corporation Device 7270
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR-
Kernel driver in use: lpc_ich
不知道你能否給我一些建議,感激不盡
LPC memory read-write 應該分為兩種,一種是 LPC,一種是可以讀寫多個資料的 FWH,不管那一種,需要先透過修改 ISA Bridge configuration 來讓 memory read-write 對映到 LPC.
回覆刪除LPC memory - 要修改 ISA Bridge configuration 98H 的值
FWH memory - 要修改 ISA Bridge configuration D0H-D7H 的值
你可以參考 intel PCH C220 的 Datasheet CH12 LPC.
只要 memory read-write 對映到 LPC, 應該就可以使用和 PCI 相同的方法來存取 FPGA.
好,我再研究看看,謝謝
刪除您好 最近在做IRQ相關的實驗 並且使用邏輯分析儀觀察波型
回覆刪除有個疑問想請教
根據Datasheet IRQ1是鍵盤的中斷
我將IRQ設為Continuous Mode
觀察波型後發現IRQ1一直被觸發
不過我鍵盤(PS/2)並沒有按下
請問是為什麼呢?
這是否跟您文中最後一段提到的有關係?
另外我按下鍵盤後發現會有幾個cycle的IRQ1變為高準位
怎麼感覺剛好相反?
任何建議都相當感謝~
老師不好意思想請問一個問題~~
回覆刪除如果TAR=0xFA是什麼意思,從字面上TAR就像是master與slave相互交換控制權
其實還是不太了解這個部分代表的含意與各個狀態
感謝~~
TAR 是指資料,也就是原本資料來自 Host, 轉為資料來自 Device.
刪除您好,我是硬體RD,遇到EC IRQ問題,在EC的datasheet中有一極性設定
回覆刪除「Interrupt Request Polarity Select:This bit indicates the polarity of of the interrupt request.
Bit=0: IRQ request is buffered and applied on SERIRQ
Bit=1: IRQ request in inverted before being applied on SERIRQ」
描述中有一個inverted字眼
若Bit設為1(預設值),是不是就是常見的"Device將訊號拉LOW以發出IRQ"?
若設為0,就會變成是high active嗎?感覺好像跟前面的網友「筆記」有點相同。
SERIRQ的protocol圖型都嘛是Low active,那麼,為什麼會有high active的機制?
任何說明都相當感謝~
據我所知, PCI 的 IRQ 都是以 Low active, EC 晶片的 inverted 應該只是預留空間,當特殊情況下使用的. EX: EC SERIRQ 的輸出有多加反向 buffer IC.
刪除