Hello Marshall Dawson,
I'd like you to do a code review. Please visit
https://review.coreboot.org/21038
to review the following change.
Change subject: amd/padmelon: Add fintek superio to devicetree
......................................................................
amd/padmelon: Add fintek superio to devicetree
Add the path to the device and enable the two UARTs. Leave
other devices disabled.
Change-Id: I73d128d5fa4227c05fcebe1ed2a3ac98b4923426
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
M src/mainboard/amd/padmelon/devicetree.cb
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/21038/1
diff --git a/src/mainboard/amd/padmelon/devicetree.cb b/src/mainboard/amd/padmelon/devicetree.cb
index 5c107e2..2b6171a 100644
--- a/src/mainboard/amd/padmelon/devicetree.cb
+++ b/src/mainboard/amd/padmelon/devicetree.cb
@@ -52,7 +52,25 @@
end
end # SM
#device pci 14.2 on end # HDA 0x4383
- device pci 14.3 on end # LPC 0x439d
+ device pci 14.3 on # LPC 0x439d
+ chip superio/fintek/f81803a
+ register "conf_key_mode" = "0x77"
+ device pnp 4e.1 on # COM1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 4e.2 on # COM2
+ io 0x60 = 0x2f8
+ irq 0x70 = 3
+ end
+ device pnp 4e.4 off end # HWM
+ device pnp 4e.5 off end # KBC
+ device pnp 4e.6 off end # GPIO
+ device pnp 4e.7 off end # WDT
+ device pnp 4e.a off end # PME
+
+ end # f81803a
+ end # LPC
device pci 14.7 on end # SD
end #chip southbridge/amd/pi/hudson
--
To view, visit https://review.coreboot.org/21038
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I73d128d5fa4227c05fcebe1ed2a3ac98b4923426
Gerrit-Change-Number: 21038
Gerrit-PatchSet: 1
Gerrit-Owner: John E. Kabat <sljkrr(a)gmail.com>
Gerrit-Reviewer: John E. Kabat Jr. <john.kabat(a)scarletltd.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Hello Marshall Dawson,
I'd like you to do a code review. Please visit
https://review.coreboot.org/21037
to review the following change.
Change subject: amd/padmelon: Enable the console
......................................................................
amd/padmelon: Enable the console
The system has two RS-232 ports connected to a Fintek F81803. Set
up the console on the first one. The superio's CLKIN is driven by
the APU's OSCOUT2 so it must be enabled. The APU's internal
UART signals are NCs so remove the configure_hudson_uart().
Change-Id: I482146b9f0acb1bb5468f8bc92c231f76bd3cb04
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
M src/mainboard/amd/padmelon/Kconfig
M src/mainboard/amd/padmelon/romstage.c
2 files changed, 8 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/37/21037/1
diff --git a/src/mainboard/amd/padmelon/Kconfig b/src/mainboard/amd/padmelon/Kconfig
index 9d89b07..7f75dc4 100644
--- a/src/mainboard/amd/padmelon/Kconfig
+++ b/src/mainboard/amd/padmelon/Kconfig
@@ -26,6 +26,8 @@
select HAVE_ACPI_TABLES
select BOARD_ROMSIZE_KB_8192
select GFXUMA
+ select SUPERIO_FINTEK_F81803A
+ select SUPERIO_FINTEK_COMMON_ROMSTAGE
config MAINBOARD_DIR
string
diff --git a/src/mainboard/amd/padmelon/romstage.c b/src/mainboard/amd/padmelon/romstage.c
index 29cd8a7..7f29002 100644
--- a/src/mainboard/amd/padmelon/romstage.c
+++ b/src/mainboard/amd/padmelon/romstage.c
@@ -23,6 +23,10 @@
#include <northbridge/amd/pi/agesawrapper.h>
#include <northbridge/amd/pi/agesawrapper_call.h>
#include <southbridge/amd/pi/hudson/hudson.h>
+#include <superio/fintek/common/fintek.h>
+#include <superio/fintek/f81803a/f81803a.h>
+
+#define SERIAL_DEV PNP_DEV(0x4e, F81803A_SP1)
void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
{
@@ -35,10 +39,9 @@
if (!cpu_init_detectedx && boot_cpu()) {
post_code(0x30);
+ hudson_clk_output_48Mhz(2);
+ fintek_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
-#if IS_ENABLED(CONFIG_HUDSON_UART)
- configure_hudson_uart();
-#endif
post_code(0x31);
console_init();
}
--
To view, visit https://review.coreboot.org/21037
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I482146b9f0acb1bb5468f8bc92c231f76bd3cb04
Gerrit-Change-Number: 21037
Gerrit-PatchSet: 1
Gerrit-Owner: John E. Kabat <sljkrr(a)gmail.com>
Gerrit-Reviewer: John E. Kabat Jr. <john.kabat(a)scarletltd.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Hello Marshall Dawson, John E. Kabat Jr.,
I'd like you to do a code review. Please visit
https://review.coreboot.org/21032
to review the following change.
Change subject: fintek/f81803a: Add new superio
......................................................................
fintek/f81803a: Add new superio
Add the F81803A device and model the source after the F81865F.
Change-Id: I2fb1a1d42d004123c3b12caf26cf0b03cd4046ec
Signed-off-by: John Kabat <john.kabat(a)scarletltd.com>
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
M src/superio/fintek/Makefile.inc
A src/superio/fintek/f81803a/Kconfig
A src/superio/fintek/f81803a/Makefile.inc
A src/superio/fintek/f81803a/f81803a.h
A src/superio/fintek/f81803a/superio.c
5 files changed, 138 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/21032/1
diff --git a/src/superio/fintek/Makefile.inc b/src/superio/fintek/Makefile.inc
index 2222644..9bd0819 100644
--- a/src/superio/fintek/Makefile.inc
+++ b/src/superio/fintek/Makefile.inc
@@ -23,5 +23,6 @@
subdirs-y += f71869ad
subdirs-y += f71872
subdirs-y += f81216h
+subdirs-y += f81803a
subdirs-y += f81865f
subdirs-y += f81866d
diff --git a/src/superio/fintek/f81803a/Kconfig b/src/superio/fintek/f81803a/Kconfig
new file mode 100644
index 0000000..6dbba97
--- /dev/null
+++ b/src/superio/fintek/f81803a/Kconfig
@@ -0,0 +1,19 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2009 Ronald G. Minnich
+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+##
+## 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; version 2 of the License.
+##
+## 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.
+##
+
+config SUPERIO_FINTEK_F81803A
+ bool
+ select SUPERIO_FINTEK_COMMON_ROMSTAGE
diff --git a/src/superio/fintek/f81803a/Makefile.inc b/src/superio/fintek/f81803a/Makefile.inc
new file mode 100644
index 0000000..9156bf9
--- /dev/null
+++ b/src/superio/fintek/f81803a/Makefile.inc
@@ -0,0 +1,17 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2011 Advanced Micro Devices, Inc.
+##
+## 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.
+##
+
+ramstage-$(CONFIG_SUPERIO_FINTEK_F81803A) += superio.c
diff --git a/src/superio/fintek/f81803a/f81803a.h b/src/superio/fintek/f81803a/f81803a.h
new file mode 100644
index 0000000..ed78cab
--- /dev/null
+++ b/src/superio/fintek/f81803a/f81803a.h
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * 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.
+ */
+
+/*
+ * Datasheet:
+ * - Name: F81803A
+ */
+#ifndef SUPERIO_FINTEK_F81803_H
+#define SUPERIO_FINTEK_F81803_H
+
+/* Logical Device Numbers (LDN). */
+#define F81803A_SP1 0x01 /* UART1 */
+#define F81803A_SP2 0x02 /* UART2 */
+#define F81803A_HWM 0x04 /* Hardware Monitor */
+#define F81803A_KBC 0x05 /* Keyboard/Mouse */
+#define F81803A_GPIO 0x06 /* General Purpose I/O (GPIO) */
+#define F81803A_WDT 0x07 /* Watch Dog Timer */
+#define F81803A_PME 0x0a /* Power Management Events (PME) */
+
+#endif /* SUPERIO_FINTEK_F81803_H */
diff --git a/src/superio/fintek/f81803a/superio.c b/src/superio/fintek/f81803a/superio.c
new file mode 100644
index 0000000..c5504c1
--- /dev/null
+++ b/src/superio/fintek/f81803a/superio.c
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * 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 <arch/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <superio/conf_mode.h>
+#include <console/console.h>
+#include <stdlib.h>
+#include <pc80/keyboard.h>
+#include "f81803a.h"
+
+static void f81803a_init(struct device *dev)
+{
+
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+ /* TODO: Might potentially need code for HWM or FDC etc. */
+ case F81803A_KBC:
+ pc_keyboard_init(NO_AUX_DEVICE);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = f81803a_init,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ /* TODO: Some of the 0x7f8 etc. values may not be correct. */
+ { &ops, F81803A_SP1, PNP_IO0 | PNP_IRQ0, 0x7f8, },
+ { &ops, F81803A_SP2, PNP_IO0 | PNP_IRQ0, 0x7f8, },
+ { &ops, F81803A_HWM, PNP_IO0 | PNP_IRQ0, 0xff8, },
+ { &ops, F81803A_KBC, PNP_IO0 | PNP_IRQ0 | PNP_IRQ1, 0x07ff, },
+ { &ops, F81803A_GPIO, PNP_IO0 | PNP_IRQ0, 0x7f8, },
+ { &ops, F81803A_WDT, PNP_IO0, 0x7f8 },
+ { &ops, F81803A_PME, },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_fintek_f81803a_ops = {
+ CHIP_NAME("Fintek F81803A Super I/O")
+ .enable_dev = enable_dev
+};
--
To view, visit https://review.coreboot.org/21032
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fb1a1d42d004123c3b12caf26cf0b03cd4046ec
Gerrit-Change-Number: 21032
Gerrit-PatchSet: 1
Gerrit-Owner: John E. Kabat <sljkrr(a)gmail.com>
Gerrit-Reviewer: John E. Kabat Jr. <john.kabat(a)scarletltd.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>