blob: 4719923e970ebca49da0970550d595b8dfb989a5 [file] [log] [blame]
Corey Osgood9d10dc42008-05-20 18:10:24 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008 Corey Osgood <corey.osgood@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Corey Osgood9d10dc42008-05-20 18:10:24 +000015 */
16
Corey Osgood9d10dc42008-05-20 18:10:24 +000017#include <device/device.h>
18#include <device/pnp.h>
Nico Huber1c811282013-06-15 20:33:44 +020019#include <superio/conf_mode.h>
Corey Osgood9d10dc42008-05-20 18:10:24 +000020#include <stdlib.h>
Corey Osgood9d10dc42008-05-20 18:10:24 +000021#include "f71805f.h"
22
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110023static void f71805f_init(struct device *dev)
Corey Osgood9d10dc42008-05-20 18:10:24 +000024{
Corey Osgood9d10dc42008-05-20 18:10:24 +000025 if (!dev->enabled)
26 return;
Zheng Bao9db833b2009-12-28 09:59:44 +000027
Corey Osgood9d10dc42008-05-20 18:10:24 +000028 /* TODO: Might potentially need code for HWM or FDC etc. */
Corey Osgood9d10dc42008-05-20 18:10:24 +000029}
30
Corey Osgood9d10dc42008-05-20 18:10:24 +000031static struct device_operations ops = {
32 .read_resources = pnp_read_resources,
Nico Huber0b2ee932013-06-15 19:58:35 +020033 .set_resources = pnp_set_resources,
34 .enable_resources = pnp_enable_resources,
35 .enable = pnp_alt_enable,
Corey Osgood9d10dc42008-05-20 18:10:24 +000036 .init = f71805f_init,
Nico Huber1c811282013-06-15 20:33:44 +020037 .ops_pnp_mode = &pnp_conf_mode_8787_aa,
Corey Osgood9d10dc42008-05-20 18:10:24 +000038};
39
40static struct pnp_info pnp_dev_info[] = {
Uwe Hermanna69d9782010-11-15 19:35:14 +000041 /* TODO: Some of the 0x07f8 etc. values may not be correct. */
Felix Held8ac8ac62018-07-06 21:43:34 +020042 { NULL, F71805F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x07f8, },
43 { NULL, F71805F_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
44 { NULL, F71805F_SP2, PNP_IO0 | PNP_IRQ0, 0x07f8, },
45 { NULL, F71805F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x07f8, },
46 { NULL, F71805F_HWM, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
47 { NULL, F71805F_GPIO, PNP_IRQ0, },
48 { NULL, F71805F_PME, },
Corey Osgood9d10dc42008-05-20 18:10:24 +000049};
50
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110051static void enable_dev(struct device *dev)
Corey Osgood9d10dc42008-05-20 18:10:24 +000052{
53 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
54}
55
56struct chip_operations superio_fintek_f71805f_ops = {
Uwe Hermann7d341882010-11-05 00:07:13 +000057 CHIP_NAME("Fintek F71805F/FG Super I/O")
Corey Osgood9d10dc42008-05-20 18:10:24 +000058 .enable_dev = enable_dev
59};