coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
superio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <device/device.h>
4 #include <device/pnp.h>
5 #include <superio/conf_mode.h>
6 #include <pc80/keyboard.h>
7 
8 #include "f71808a.h"
9 #include "fintek_internal.h"
10 
11 static void f71808a_init(struct device *dev)
12 {
13  if (!dev->enabled)
14  return;
15 
16  switch (dev->path.pnp.device) {
17  /* TODO: Might potentially need code for UART, GPIO... */
18  case F71808A_KBC:
20  break;
21  case F71808A_HWM:
23  f71808a_hwm_init(dev);
24  break;
25  }
26 }
27 
28 static struct device_operations ops = {
30  .set_resources = pnp_set_resources,
31  .enable_resources = pnp_enable_resources,
32  .enable = pnp_alt_enable,
33  .init = f71808a_init,
34  .ops_pnp_mode = &pnp_conf_mode_8787_aa,
35 };
36 
37 static struct pnp_info pnp_dev_info[] = {
38  /* TODO: Some of the 0x07f8 etc. values may not be correct. */
39  { NULL, F71808A_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
40  { NULL, F71808A_HWM, PNP_IO0 | PNP_IRQ0, 0x07f8, },
41  { NULL, F71808A_KBC, PNP_IO0 | PNP_IRQ0 | PNP_IRQ1, 0x07ff, },
42  { NULL, F71808A_GPIO, PNP_IRQ0, },
43  { NULL, F71808A_WDT, PNP_IO0, 0x07f8,},
44  { NULL, F71808A_CIR, PNP_IO0 | PNP_IRQ0, 0x07f8, },
45  { NULL, F71808A_PME, },
46 };
47 
48 static void enable_dev(struct device *dev)
49 {
51 }
52 
54  CHIP_NAME("Fintek F71808A Super I/O")
55  .enable_dev = enable_dev
56 };
#define ARRAY_SIZE(a)
Definition: helpers.h:12
const struct pnp_mode_ops pnp_conf_mode_8787_aa
Definition: conf_mode.c:202
#define F71808A_PME
Definition: f71808a.h:13
#define F71808A_SP1
Definition: f71808a.h:7
#define F71808A_KBC
Definition: f71808a.h:9
#define F71808A_CIR
Definition: f71808a.h:12
#define F71808A_HWM
Definition: f71808a.h:8
#define F71808A_GPIO
Definition: f71808a.h:10
#define F71808A_WDT
Definition: f71808a.h:11
void f71808a_hwm_init(struct device *dev)
Definition: f71808a_hwm.c:36
void f71808a_multifunc_init(struct device *dev)
static void enable_dev(struct device *dev)
Definition: superio.c:48
static struct device_operations ops
Definition: superio.c:28
static struct pnp_info pnp_dev_info[]
Definition: superio.c:37
static void f71808a_init(struct device *dev)
Definition: superio.c:11
struct chip_operations superio_fintek_f71808a_ops
Definition: superio.c:53
#define CHIP_NAME(X)
Definition: device.h:32
uint8_t pc_keyboard_init(uint8_t probe_aux)
Definition: keyboard.c:229
#define NO_AUX_DEVICE
Definition: keyboard.h:6
#define PNP_IRQ1
Definition: pnp.h:48
#define PNP_IO0
Definition: pnp.h:42
#define PNP_IRQ0
Definition: pnp.h:47
void pnp_read_resources(struct device *dev)
Definition: pnp_device.c:114
void pnp_enable_devices(struct device *base_dev, struct device_operations *ops, unsigned int functions, struct pnp_info *info)
Definition: pnp_device.c:371
void pnp_set_resources(struct device *dev)
Definition: pnp_device.c:157
void pnp_alt_enable(struct device *dev)
Definition: pnp_device.c:191
void pnp_enable_resources(struct device *dev)
Definition: pnp_device.c:173
#define NULL
Definition: stddef.h:19
void(* read_resources)(struct device *dev)
Definition: device.h:39
struct pnp_path pnp
Definition: path.h:117
Definition: device.h:107
struct device_path path
Definition: device.h:115
unsigned int enabled
Definition: device.h:122
Definition: pnp.h:37
unsigned int device
Definition: path.h:59