summaryrefslogtreecommitdiff
path: root/src/mainboard/amd/bettong
diff options
context:
space:
mode:
authorMichał Żygowski <michal.zygowski@3mdeb.com>2019-12-01 17:42:04 +0100
committerKyösti Mälkki <kyosti.malkki@gmail.com>2020-01-12 19:28:33 +0000
commitaf258cc1791b5c46fcb13d41128cc99043a435be (patch)
tree3c143244682d60fed4172086832ae9e4ad66fd76 /src/mainboard/amd/bettong
parentcbbfb702f693c1bbaf83a9d3d8a3c0caabda1814 (diff)
mb/*/*: use ACPIMMIO common block wherever possible
TEST=boot PC Engines apu2 and launch Debian Linux Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Change-Id: I648167ec94367c9494c4253bec21dab20ad7b615 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37401 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'src/mainboard/amd/bettong')
-rw-r--r--src/mainboard/amd/bettong/boardid.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mainboard/amd/bettong/boardid.c b/src/mainboard/amd/bettong/boardid.c
index a3c568f820..21d0476204 100644
--- a/src/mainboard/amd/bettong/boardid.c
+++ b/src/mainboard/amd/bettong/boardid.c
@@ -14,6 +14,7 @@
*/
#include <stdint.h>
+#include <amdblocks/acpimmio.h>
#include <device/mmio.h>
#include <southbridge/amd/common/amd_defs.h>
#include <boardid.h>
@@ -30,17 +31,15 @@
*/
uint32_t board_id(void)
{
- void *gpiommioaddr;
u8 value = 0;
u8 boardrev = 0;
char boardid;
- gpiommioaddr = (void *)AMD_SB_ACPI_MMIO_ADDR + 0x1500;
- value = read8(gpiommioaddr + (7 << 2) + 2); /* agpio7: board_id2 */
+ value = gpio0_read8((7 << 2) + 2); /* agpio7: board_id2 */
boardrev = value & 1;
- value = read8(gpiommioaddr + (6 << 2) + 2); /* agpio6: board_id1 */
+ value = gpio0_read8((6 << 2) + 2); /* agpio6: board_id1 */
boardrev |= (value & 1) << 1;
- value = read8(gpiommioaddr + (5 << 2) + 2); /* agpio5: board_id0 */
+ value = gpio0_read8((5 << 2) + 2); /* agpio5: board_id0 */
boardrev |= (value & 1) << 2;
boardid = 'A' + boardrev;