Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2009 University of Heidelberg |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 5 | * Written by Mondrian Nuessle <nuessle@uni-heidelberg.de> for Univ. Heidelberg |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 6 | * |
| 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 16 | */ |
| 17 | |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 18 | /* PILOT Super I/O is only based on LPC observation done on factory system. */ |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 19 | |
| 20 | #define BLUBB_DEV PNP_DEV(port, 0x04) |
| 21 | |
Edward O'Callaghan | f18abab | 2014-03-31 21:53:32 +1100 | [diff] [blame] | 22 | #include <arch/io.h> |
| 23 | #include <console/console.h> |
| 24 | #include <device/pnp.h> |
| 25 | #include "pilot.h" |
| 26 | |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 27 | /* |
| 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'Callaghan | 85836c2 | 2014-07-09 20:26:25 +1000 | [diff] [blame] | 31 | void pilot_early_init(pnp_devfn_t dev) |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 32 | { |
Uwe Hermann | 8c02368 | 2010-11-06 23:36:49 +0000 | [diff] [blame] | 33 | u16 port = dev >> 8; |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 34 | |
Stefan Reinauer | d42c9dae8 | 2015-01-05 13:05:44 -0800 | [diff] [blame] | 35 | printk(BIOS_DEBUG, "Using port: %04x\n", port); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 36 | pilot_disable_serial(PNP_DEV(port, 0x1)); |
Stefan Reinauer | d42c9dae8 | 2015-01-05 13:05:44 -0800 | [diff] [blame] | 37 | printk(BIOS_DEBUG, "disable serial 1\n"); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 38 | |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 39 | 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 49 | /* |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 50 | pnp_enter_ext_func_mode(dev); |
| 51 | pnp_set_logical_device(PNP_DEV(port, 0x3)); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 52 | pnp_exit_ext_func_mode(dev); |
| 53 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 54 | pnp_set_enable(PNP_DEV(port, 0x3), 0); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 55 | pnp_exit_ext_func_mode(dev); |
| 56 | */ |
Uwe Hermann | 8c02368 | 2010-11-06 23:36:49 +0000 | [diff] [blame] | 57 | |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 58 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 59 | pnp_set_logical_device(PNP_DEV(port, 0x4)); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 60 | pnp_exit_ext_func_mode(dev); |
| 61 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 62 | pnp_set_enable( PNP_DEV(port, 0x4), 0); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 63 | pnp_exit_ext_func_mode(dev); |
| 64 | |
| 65 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 66 | pnp_set_logical_device(PNP_DEV(port, 0x5)); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 67 | pnp_exit_ext_func_mode(dev); |
| 68 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 69 | pnp_set_enable(PNP_DEV(port, 0x5), 0); |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 70 | pnp_exit_ext_func_mode(dev); |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 71 | |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 72 | pnp_enter_ext_func_mode(dev); |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 73 | pnp_set_logical_device(PNP_DEV(port, 0x6)); |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 74 | 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 80 | pnp_exit_ext_func_mode(dev); |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 81 | |
Mondrian nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 82 | pnp_enter_ext_func_mode(dev); |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 83 | 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 90 | pnp_exit_ext_func_mode(dev); |
Arne Georg Gleditsch | 9139e7b | 2010-09-24 17:35:32 +0000 | [diff] [blame] | 91 | |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 92 | 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 Hermann | 8c02368 | 2010-11-06 23:36:49 +0000 | [diff] [blame] | 98 | |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 99 | /* |
| 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 106 | |
Uwe Hermann | fff87d3 | 2009-06-01 01:38:29 +0000 | [diff] [blame] | 107 | 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 nuessle | 21da019 | 2009-04-22 20:30:42 +0000 | [diff] [blame] | 121 | } |