summaryrefslogtreecommitdiff
path: root/src/mainboard/pcengines/apu1
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/pcengines/apu1')
-rw-r--r--src/mainboard/pcengines/apu1/gpio_ftns.c16
-rw-r--r--src/mainboard/pcengines/apu1/gpio_ftns.h4
-rw-r--r--src/mainboard/pcengines/apu1/mainboard.c19
3 files changed, 18 insertions, 21 deletions
diff --git a/src/mainboard/pcengines/apu1/gpio_ftns.c b/src/mainboard/pcengines/apu1/gpio_ftns.c
index 4e58d5593b..206dc63c9d 100644
--- a/src/mainboard/pcengines/apu1/gpio_ftns.c
+++ b/src/mainboard/pcengines/apu1/gpio_ftns.c
@@ -27,25 +27,21 @@ uintptr_t find_gpio_base(void)
return base_addr;
}
-void configure_gpio(uintptr_t base_addr, u32 gpio, u8 iomux_ftn, u8 setting)
+void configure_gpio(uintptr_t base_addr, u8 gpio, u8 iomux_ftn, u8 setting)
{
u8 bdata;
- u8 *memptr;
- memptr = (u8 *)(base_addr + IOMUX_OFFSET + gpio);
- *memptr = iomux_ftn;
+ iomux_write8(gpio, iomux_ftn);
- memptr = (u8 *)(base_addr + GPIO_OFFSET + gpio);
- bdata = *memptr;
+ bdata = gpio_100_read8(gpio);
bdata &= 0x07;
bdata |= setting; /* set direction and data value */
- *memptr = bdata;
+ gpio_100_write8(gpio, bdata);
}
-u8 read_gpio(uintptr_t base_addr, u32 gpio)
+u8 read_gpio(uintptr_t base_addr, u8 gpio)
{
- u8 *memptr = (u8 *)(base_addr + GPIO_OFFSET + gpio);
- return (*memptr & GPIO_DATA_IN) ? 1 : 0;
+ return (gpio_100_read8(gpio) & GPIO_DATA_IN) ? 1 : 0;
}
int get_spd_offset(void)
diff --git a/src/mainboard/pcengines/apu1/gpio_ftns.h b/src/mainboard/pcengines/apu1/gpio_ftns.h
index fce8afe6f0..fb582721d2 100644
--- a/src/mainboard/pcengines/apu1/gpio_ftns.h
+++ b/src/mainboard/pcengines/apu1/gpio_ftns.h
@@ -19,8 +19,8 @@
#include <stdint.h>
uintptr_t find_gpio_base(void);
-void configure_gpio(uintptr_t base_addr, u32 gpio, u8 iomux_ftn, u8 setting);
-u8 read_gpio(uintptr_t base_addr, u32 gpio);
+void configure_gpio(uintptr_t base_addr, u8 gpio, u8 iomux_ftn, u8 setting);
+u8 read_gpio(uintptr_t base_addr, u8 gpio);
int get_spd_offset(void);
#define IOMUX_OFFSET 0xD00
diff --git a/src/mainboard/pcengines/apu1/mainboard.c b/src/mainboard/pcengines/apu1/mainboard.c
index 854fb8ad4d..0528468e5d 100644
--- a/src/mainboard/pcengines/apu1/mainboard.c
+++ b/src/mainboard/pcengines/apu1/mainboard.c
@@ -14,6 +14,7 @@
* GNU General Public License for more details.
*/
+#include <amdblocks/acpimmio.h>
#include <console/console.h>
#include <device/device.h>
#include <device/mmio.h>
@@ -181,17 +182,17 @@ static void mainboard_enable(struct device *dev)
config_gpio_mux();
config_addon_uart();
- /* Power off unused clock pins of GPP PCIe devices */
- u8 *misc_mem_clk_cntrl = (u8 *)(ACPI_MMIO_BASE + MISC_BASE);
- /* GPP CLK0-2 are connected to the 3 ethernet chips
- * GPP CLK3-4 are connected to the miniPCIe slots */
- write8(misc_mem_clk_cntrl + 0, 0x21);
- write8(misc_mem_clk_cntrl + 1, 0x43);
+ /* Power off unused clock pins of GPP PCIe devices
+ * GPP CLK0-2 are connected to the 3 ethernet chips
+ * GPP CLK3-4 are connected to the miniPCIe slots
+ */
+ misc_write8(0, 0x21);
+ misc_write8(1, 0x43);
/* GPP CLK5 is only connected to test pads -> disable */
- write8(misc_mem_clk_cntrl + 2, 0x05);
+ misc_write8(2, 0x05);
/* disable unconnected GPP CLK6-8 and SLT_GFX_CLK */
- write8(misc_mem_clk_cntrl + 3, 0x00);
- write8(misc_mem_clk_cntrl + 4, 0x00);
+ misc_write8(3, 0);
+ misc_write8(4, 0);
/* Initialize the PIRQ data structures for consumption */
pirq_setup();