blob: b8243ece51fd875cb8c091c84c508d59b6114812 [file] [log] [blame]
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2008 coresystems GmbH
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; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000014 */
15
16#include <stdlib.h>
17#include <device/device.h>
18#include <device/pnp.h>
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000019#include <pc80/keyboard.h>
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000020#include "sio10n268.h"
21
Edward O'Callaghan2c9d2cf2014-10-27 23:29:29 +110022static void init(struct device *dev)
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000023{
Uwe Hermanna69d9782010-11-15 19:35:14 +000024 if (!dev->enabled)
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000025 return;
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000026
27 switch (dev->path.pnp.device) {
28 case SIO10N268_FDC: /* TODO. */
29 break;
30 case SIO10N268_PP: /* TODO. */
31 break;
32 case SIO10N268_KBDC:
33 /* TODO: This is still hardcoded. */
Timothy Pearson448e3862015-11-24 14:12:01 -060034 pc_keyboard_init(NO_AUX_DEVICE);
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000035 break;
36 // [..] The rest: TODO
37 }
38}
39
40static struct device_operations ops = {
41 .read_resources = pnp_read_resources,
42 .set_resources = pnp_set_resources,
43 .enable_resources = pnp_enable_resources,
44 .enable = pnp_enable,
45 .init = init,
46};
47
48/* TODO: FDC, PP, AUX. */
49static struct pnp_info pnp_dev_info[] = {
Felix Heldb0d868e2018-07-06 23:39:00 +020050 { NULL, SIO10N268_KBDC, PNP_IO0 | PNP_IO1, 0x07f8, 0x07f8, },
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000051};
52
53static void enable_dev(struct device *dev)
54{
Felix Heldb0d868e2018-07-06 23:39:00 +020055 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
Stefan Reinauer9e7a5d42010-05-16 14:08:32 +000056}
57
58struct chip_operations superio_smsc_sio10n268_ops = {
59 CHIP_NAME("SMSC SIO10N268 Super I/O")
60 .enable_dev = enable_dev,
61};