aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/pcengines/apu1/mainboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/pcengines/apu1/mainboard.c')
-rw-r--r--src/mainboard/pcengines/apu1/mainboard.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c
index 3b8541cae1..f49059d871 100644
--- a/src/mainboard/pcengines/apu1/mainboard.c
+++ b/src/mainboard/pcengines/apu1/mainboard.c
@@ -33,6 +33,7 @@
#include "SBPLATFORM.h"
#include <southbridge/amd/cimx/sb800/pci_devs.h>
#include <northbridge/amd/agesa/family14/pci_devs.h>
+#include <superio/nuvoton/nct5104d/nct5104d.h>
#include "gpio_ftns.h"
void set_pcie_reset(void);
@@ -135,6 +136,30 @@ static void pirq_setup(void)
picr_data_ptr = mainboard_picr_data;
}
+/* Wrapper to enable GPIO/UART devices under menuconfig. Revisit
+ * once configuration file format for SPI flash storage is complete.
+ */
+#define SIO_PORT 0x2e
+
+static void config_gpio_mux(void)
+{
+ struct device *uart, *gpio;
+
+ uart = dev_find_slot_pnp(SIO_PORT, NCT5104D_SP3);
+ gpio = dev_find_slot_pnp(SIO_PORT, NCT5104D_GPIO0);
+ if (uart)
+ uart->enabled = CONFIG_PINMUX_UART_C;
+ if (gpio)
+ gpio->enabled = CONFIG_PINMUX_GPIO0;
+
+ uart = dev_find_slot_pnp(SIO_PORT, NCT5104D_SP4);
+ gpio = dev_find_slot_pnp(SIO_PORT, NCT5104D_GPIO1);
+ if (uart)
+ uart->enabled = CONFIG_PINMUX_UART_D;
+ if (gpio)
+ gpio->enabled = CONFIG_PINMUX_GPIO1;
+}
+
/**
* TODO
* SB CIMx callback
@@ -158,6 +183,8 @@ static void mainboard_enable(device_t dev)
{
printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
+ config_gpio_mux();
+
/* Initialize the PIRQ data structures for consumption */
pirq_setup();
}