diff options
author | Edward O'Callaghan <quasisec@google.com> | 2023-01-01 14:33:51 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2023-02-04 04:09:04 +0000 |
commit | 195948a4675edd8674986b19f2036320eb8ba1c8 (patch) | |
tree | 863bf6e8d6ac66334f3b508d37f4ecd7a776c073 /superio.c | |
parent | ec6eaff2f8d5402c028668f12fbec6fdb9d8fb14 (diff) | |
download | flashrom-195948a4675edd8674986b19f2036320eb8ba1c8.tar.gz flashrom-195948a4675edd8674986b19f2036320eb8ba1c8.tar.bz2 flashrom-195948a4675edd8674986b19f2036320eb8ba1c8.zip |
internal.c: Move sio register to own object
While super i/o is related to the internal programmer it
isn't actually _the_ internal programmer. Move register
logic to its own object consistent with other programmer
types.
Change-Id: I9a4c3e12bce5d22492c8d1b8f4a3f49d736dcf31
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/71577
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'superio.c')
-rw-r--r-- | superio.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/superio.c b/superio.c new file mode 100644 index 00000000..3121578d --- /dev/null +++ b/superio.c @@ -0,0 +1,42 @@ +/* + * This file is part of the flashrom project. + * + * Copyright (C) 2009 Carl-Daniel Hailfinger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include "programmer.h" + +int superio_count = 0; +#define SUPERIO_MAX_COUNT 3 + +struct superio superios[SUPERIO_MAX_COUNT]; + +int register_superio(struct superio s) +{ + if (superio_count == SUPERIO_MAX_COUNT) + return 1; + superios[superio_count++] = s; + return 0; +} + +void probe_superio(void) +{ + probe_superio_winbond(); + /* ITE probe causes SMSC LPC47N217 to power off the serial UART. + * Always probe for SMSC first, and if a SMSC Super I/O is detected + * at a given I/O port, do _not_ probe that port with the ITE probe. + * This means SMSC probing must be done before ITE probing. + */ + //probe_superio_smsc(); + probe_superio_ite(); +} |