blob: b3ad0480b32a89886c910229fad2b4a861147f40 [file] [log] [blame]
Kerry Sheh3c71a852012-02-07 20:31:40 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Advanced Micro Devices, Inc.
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.
Kerry Sheh3c71a852012-02-07 20:31:40 +080014 */
15
16/* RAM driver for the SMSC SIO1036 Super I/O chip */
17
18#include <arch/io.h>
19#include <device/device.h>
20#include <device/pnp.h>
Nico Huber1c811282013-06-15 20:33:44 +020021#include <superio/conf_mode.h>
Kerry Sheh3c71a852012-02-07 20:31:40 +080022#include <console/console.h>
Kerry Sheh3c71a852012-02-07 20:31:40 +080023#include <stdlib.h>
Edward O'Callaghan4e9f5e3f2014-08-02 20:45:13 +100024
Kerry Sheh3c71a852012-02-07 20:31:40 +080025#include "sio1036.h"
26
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110027static void sio1036_init(struct device *dev)
Edward O'Callaghan4e9f5e3f2014-08-02 20:45:13 +100028{
29 if (!dev->enabled) {
30 return;
31 }
32}
Kerry Sheh3c71a852012-02-07 20:31:40 +080033
34static struct device_operations ops = {
35 .read_resources = pnp_read_resources,
Nico Huber0b2ee932013-06-15 19:58:35 +020036 .set_resources = pnp_set_resources,
37 .enable_resources = pnp_enable_resources,
38 .enable = pnp_alt_enable,
Kerry Sheh3c71a852012-02-07 20:31:40 +080039 .init = sio1036_init,
Nico Huber1c811282013-06-15 20:33:44 +020040 .ops_pnp_mode = &pnp_conf_mode_55_aa,
Kerry Sheh3c71a852012-02-07 20:31:40 +080041};
42
43static struct pnp_info pnp_dev_info[] = {
Edward O'Callaghan4e9f5e3f2014-08-02 20:45:13 +100044 { &ops, SIO1036_SP1, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
Kerry Sheh3c71a852012-02-07 20:31:40 +080045};
46
Edward O'Callaghanf21bdc32014-10-21 07:43:41 +110047static void enable_dev(struct device *dev)
Kerry Sheh3c71a852012-02-07 20:31:40 +080048{
Edward O'Callaghan4e9f5e3f2014-08-02 20:45:13 +100049 pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
Kerry Sheh3c71a852012-02-07 20:31:40 +080050}
51
Edward O'Callaghan4e9f5e3f2014-08-02 20:45:13 +100052struct chip_operations superio_smsc_sio1036_ops = {
53 CHIP_NAME("SMSC SIO1036 Super I/O")
54 .enable_dev = enable_dev
55};