blob: acd2ab4d932e8d3177e30485c7c84ee738ce9a90 [file] [log] [blame]
Mondrian nuessle21da0192009-04-22 20:30:42 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2009 University of Heidelberg
Uwe Hermannfff87d32009-06-01 01:38:29 +00005 * Written by Mondrian Nuessle <nuessle@uni-heidelberg.de> for Univ. Heidelberg
Mondrian nuessle21da0192009-04-22 20:30:42 +00006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Mondrian nuessle21da0192009-04-22 20:30:42 +000016 */
17
Uwe Hermannfff87d32009-06-01 01:38:29 +000018/* PILOT Super I/O is only based on LPC observation done on factory system. */
Mondrian nuessle21da0192009-04-22 20:30:42 +000019
20#define BLUBB_DEV PNP_DEV(port, 0x04)
21
Edward O'Callaghanf18abab2014-03-31 21:53:32 +110022#include <arch/io.h>
23#include <console/console.h>
24#include <device/pnp.h>
25#include "pilot.h"
26
Uwe Hermannfff87d32009-06-01 01:38:29 +000027/*
28 * Logical device 4, 5 and 7 are being deactivated. Logical Device 1 seems to
29 * be another serial (?), it is also deactivated on the HP machine.
30 */
Edward O'Callaghan85836c22014-07-09 20:26:25 +100031void pilot_early_init(pnp_devfn_t dev)
Mondrian nuessle21da0192009-04-22 20:30:42 +000032{
Uwe Hermann8c023682010-11-06 23:36:49 +000033 u16 port = dev >> 8;
Uwe Hermannfff87d32009-06-01 01:38:29 +000034
Stefan Reinauerd42c9dae82015-01-05 13:05:44 -080035 printk(BIOS_DEBUG, "Using port: %04x\n", port);
Uwe Hermannfff87d32009-06-01 01:38:29 +000036 pilot_disable_serial(PNP_DEV(port, 0x1));
Stefan Reinauerd42c9dae82015-01-05 13:05:44 -080037 printk(BIOS_DEBUG, "disable serial 1\n");
Mondrian nuessle21da0192009-04-22 20:30:42 +000038
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000039 pnp_enter_ext_func_mode(dev);
40 pnp_set_logical_device(PNP_DEV(port, 0x3));
41 pnp_set_enable(dev, 0);
42 pnp_set_iobase(dev, 0x60, 0x0b00);
43 pnp_set_iobase(dev, 0x62, 0x0b80);
44 pnp_set_iobase(dev, 0x64, 0x0b84);
45 pnp_set_iobase(dev, 0x66, 0x0b86);
46 pnp_set_enable(dev, 1);
47 pnp_exit_ext_func_mode(dev);
48
Mondrian nuessle21da0192009-04-22 20:30:42 +000049/*
Uwe Hermannfff87d32009-06-01 01:38:29 +000050 pnp_enter_ext_func_mode(dev);
51 pnp_set_logical_device(PNP_DEV(port, 0x3));
Mondrian nuessle21da0192009-04-22 20:30:42 +000052 pnp_exit_ext_func_mode(dev);
53 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000054 pnp_set_enable(PNP_DEV(port, 0x3), 0);
Mondrian nuessle21da0192009-04-22 20:30:42 +000055 pnp_exit_ext_func_mode(dev);
56*/
Uwe Hermann8c023682010-11-06 23:36:49 +000057
Mondrian nuessle21da0192009-04-22 20:30:42 +000058 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000059 pnp_set_logical_device(PNP_DEV(port, 0x4));
Mondrian nuessle21da0192009-04-22 20:30:42 +000060 pnp_exit_ext_func_mode(dev);
61 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000062 pnp_set_enable( PNP_DEV(port, 0x4), 0);
Mondrian nuessle21da0192009-04-22 20:30:42 +000063 pnp_exit_ext_func_mode(dev);
64
65 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000066 pnp_set_logical_device(PNP_DEV(port, 0x5));
Mondrian nuessle21da0192009-04-22 20:30:42 +000067 pnp_exit_ext_func_mode(dev);
68 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000069 pnp_set_enable(PNP_DEV(port, 0x5), 0);
Mondrian nuessle21da0192009-04-22 20:30:42 +000070 pnp_exit_ext_func_mode(dev);
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000071
Mondrian nuessle21da0192009-04-22 20:30:42 +000072 pnp_enter_ext_func_mode(dev);
Uwe Hermannfff87d32009-06-01 01:38:29 +000073 pnp_set_logical_device(PNP_DEV(port, 0x6));
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000074 pnp_set_enable(dev, 0);
75 pnp_set_iobase(dev, PNP_IDX_IO0, 0x60);
76 pnp_set_iobase(dev, PNP_IDX_IO1, 0x64);
77 pnp_set_irq(dev, PNP_IDX_IRQ0, 1);
78 pnp_set_drq(dev, 0x71, 3);
79 pnp_set_enable(dev, 0);
Mondrian nuessle21da0192009-04-22 20:30:42 +000080 pnp_exit_ext_func_mode(dev);
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000081
Mondrian nuessle21da0192009-04-22 20:30:42 +000082 pnp_enter_ext_func_mode(dev);
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000083 pnp_set_logical_device(PNP_DEV(port, 0xe));
84 pnp_set_enable(dev, 0);
85 pnp_set_iobase(dev, PNP_IDX_IO0, 0x70);
86 pnp_set_iobase(dev, PNP_IDX_IO1, 0x72);
87 pnp_set_irq(dev, PNP_IDX_IRQ0, 8);
88 pnp_set_drq(dev, 0x71, 3);
89 pnp_set_enable(dev, 0);
Mondrian nuessle21da0192009-04-22 20:30:42 +000090 pnp_exit_ext_func_mode(dev);
Arne Georg Gleditsch9139e7b2010-09-24 17:35:32 +000091
Uwe Hermannfff87d32009-06-01 01:38:29 +000092 pnp_enter_ext_func_mode(dev);
93 pnp_set_logical_device(PNP_DEV(port, 0x7));
94 pnp_exit_ext_func_mode(dev);
95 pnp_enter_ext_func_mode(dev);
96 pnp_set_enable(PNP_DEV(port, 0x7), 0);
97 pnp_exit_ext_func_mode(dev);
Uwe Hermann8c023682010-11-06 23:36:49 +000098
Uwe Hermannfff87d32009-06-01 01:38:29 +000099/*
100 pnp_enter_ext_func_mode(dev);
101 pnp_set_logical_device(PNP_DEV(port, 0x8));
102 pnp_exit_ext_func_mode(dev);
103 pnp_enter_ext_func_mode(dev);
104 pnp_set_enable(PNP_DEV(port, 0x8), 0);
105 pnp_exit_ext_func_mode(dev);
Mondrian nuessle21da0192009-04-22 20:30:42 +0000106
Uwe Hermannfff87d32009-06-01 01:38:29 +0000107 pnp_enter_ext_func_mode(dev);
108 pnp_set_logical_device(PNP_DEV(port, 0x9));
109 pnp_exit_ext_func_mode(dev);
110 pnp_enter_ext_func_mode(dev);
111 pnp_set_enable(PNP_DEV(port, 0x9), 0);
112 pnp_exit_ext_func_mode(dev);
113
114 pnp_enter_ext_func_mode(dev);
115 pnp_set_logical_device(PNP_DEV(port, 0x10));
116 pnp_exit_ext_func_mode(dev);
117 pnp_enter_ext_func_mode(dev);
118 pnp_set_enable(PNP_DEV(port, 0x10), 0);
119 pnp_exit_ext_func_mode(dev);
120*/
Mondrian nuessle21da0192009-04-22 20:30:42 +0000121}