Make the code a bit more generic (trivial). Different Super I/Os
use different config ports. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2782 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/io.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
#define EOT -1 /* End Of Table */
|
||||
#define NOLDN -2 /* NO LDN needed */
|
||||
#define NANA -3 /* Not Available */
|
||||
@@ -36,6 +38,7 @@
|
||||
#define LDNSIZE (MAXLDN + 3) /* Biggest LDN + 0 + NOLDN + EOT */
|
||||
#define MAXNUMIDX 70 /* Maximum number of indexes */
|
||||
#define IDXSIZE (MAXNUMIDX + 1)
|
||||
#define MAXNUMPORTS (2 + 1) /* Maximum number of Super I/O ports */
|
||||
|
||||
struct superio_registers {
|
||||
/* Yes, superio_id should be unsigned, but EOT has to be negative. */
|
||||
@@ -69,6 +72,17 @@ void probe_idregs_simple(unsigned short port);
|
||||
|
||||
/* smsc.c */
|
||||
void dump_smsc(uint32_t port, uint32_t id);
|
||||
void probe_idregs_smsc(uint32_t port);
|
||||
void probe_idregs_smsc(unsigned short port);
|
||||
|
||||
/** Table of which config ports to probe on each Super I/O. */
|
||||
const static struct {
|
||||
void (*probe_idregs) (unsigned short port);
|
||||
signed short ports[MAXNUMPORTS]; /* Signed, as we need EOT. */
|
||||
} superio_ports_table[] = {
|
||||
{probe_idregs_simple, {0x2e, 0x4e, EOT}},
|
||||
{probe_idregs_fintek, {0x2e, 0x4e, EOT}},
|
||||
{probe_idregs_ite, {0x2e, 0x4e, EOT}},
|
||||
{probe_idregs_smsc, {0x3f0, 0x370, EOT}},
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user