Difference between revisions of "Developer Manual/Super IO"

From coreboot
Jump to navigation Jump to search
Line 8: Line 8:


Adding support for a new Super I/O chip is usually not significantly hard once you have obtained the datasheet for your target chip. Herein we shall outline the steps usally taken for a bringup.
Adding support for a new Super I/O chip is usually not significantly hard once you have obtained the datasheet for your target chip. Herein we shall outline the steps usally taken for a bringup.
=== Virtual Logical Devices (LDN) ===
Many Super I/O's use register 0x30 of one logical device number (LDN) for more than one function enable.
For example, it can be used to enable some GPIOs, GAME, MIDI etc. To overcome this issue a concept of virtual LDN has been introduced.
Virtual LDN's can be used in Coreboot to map the enable bit position in register 0x30 to virtual LDN, which will just enable the functionality map to that bit.
Original LDN always just switch on or off bit0 of register 0x30, however a virtual LDN is created as follows.
Low [7:0] bits are used to describe the original LDN. High [10:8] bits select the position of the bit enable in the register 0x30.
If LDN is 0x7 it will handle bit0 of register 0x30. If the (virtual) LDN is 0x107 it will handle bit1 of same register etc.
TODO: Improvements needed here for the layman.


== Source layout ==
== Source layout ==
Line 121: Line 134:
   */
   */


=== Virtual logical devices ===
A typical superio.c would look like this:
 
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
#include <superio/conf_mode.h>
#include <console/console.h>
#include <stdlib.h>
#include "f71869ad.h"
static void f71869ad_init(device_t dev)
{
= dev->chip_info;
}


Some Super I/Os use register 0x30 of one logical device number (LDN) for more than one function enable. For example, it can be used to enable some GPIOs, GAME, MIDI etc. To overcome this issue a concept of virtual LDN has been introduced. Virtual LDNs can be used in coreboot to map the enable bit position in register 0x30 to virtual LDN, which will just enable the functionality map to that bit.
static struct device_operations ops = {
.read_resources = pnp_read_resources,
,
,
.enable = pnp_alt_enable,
.init = f71869ad_init,
.ops_pnp_mode = &pnp_conf_mode_8787_aa,
};


Original LDN always just switch on or off bit0 of register 0x30. Virtual LDN is created as follows. Low [7:0] bits are used to describe the original LDN. High [10:8] bits select the position of the bit enable in the register 0x30.
static struct pnp_info pnp_dev_info[] = {
0}, },
};


If LDN is 0x7 it will handle bit0 of register 0x30. If the (virtual) LDN is 0x107 it will handle bit1 of same register etc.
static void enable_dev(device_t dev)
{
}
struct chip_operations superio_fintek_f71869ad_ops = {
("Fintek F71869AD Super I/O")
.enable_dev = enable_dev
};
85 +

Revision as of 09:12, 8 February 2014