Direct I/O :

  指的是給定Index(0x00xFFFF),然後直接對Register 作存取

  EFI code :

  Status = IoDev->Io.Read ( IoDev, EfiCpuIoWidthUint8, Index, 1, &Data);

  Status = IoDev->Io.Write( IoDev, EfiCpuIoWidthUint8, Index, 1, &Data);

Indirect I/O : (ISA mode)

  指的是對一組 Index & Data port ,由index port 寫入register address

  ,此動作為定址要做讀寫的register。然後對Data port做讀寫即可。

  Read :  

  Status = IoDev->Io.Write ( IoDev, EfiCpuIoWidthUint8, IPort, 1, &Index);
  Status = IoDev->Io.Read  ( IoDev, EfiCpuIoWidthUint8, DPort, 1, &Data);
 

  Write: 

  Status = IoDev->Io.Write ( IoDev, EfiCpuIoWidthUint8, IPort, 1, &Index);
  Status = IoDev->Io.Write ( IoDev, EfiCpuIoWidthUint8, DPort, 1, &Data);

Super I/O :

      siodia

                                          Super I/O 晶片

 KBC 位於SuperIO 晶片裡,對外直接連接KB & Mouse 。對內(LPC bus)連接至PCH的PCI to LPC Bridge。

 

Super IO access :

 2e2f

 2e

 

 對2E or 4E (configuration port) 寫入四組Value,進入 PnP Mode。

 Exit the MB PnP Mode 
 
 Set bit 1 of the configure control register (Index=02h) to “1” to exit the MB PnP Mode. 
 

Access Device's Register 

Before accessing a selected register, the content of Index 07h must be changed to the LDN.

00h  FDC

01h  Serial Port 1

02h  Serial Port 2

03h  Parallel Port

04h  Environment Controller

05h  KBC(Keyboard)

06h  KBC(Mouse)

07h  GPIO

0Ah  Consumer IR

 kb

 60h, 61h, 62h, 63h 為KB BAR

 70h 為中斷IRQ號碼,KB為IRQ1, Default 為1,

 改70h為非01h會造成KB 無法使用,因為會無法access 正確的中斷向量表

 

p.s. Sub 說 mouse 也是使用KB BAR。

 

 

文章標籤
全站熱搜
創作者介紹
創作者 linch0520 的頭像
linch0520

linch0520的部落格

linch0520 發表在 痞客邦 留言(0) 人氣(12,490)