blob: 07c72e49e0f018f06c83e897d22c6704261509fd [file] [log] [blame]
Chin Liang See70fa4e72013-09-11 11:24:48 -05001/*
Marek Vasut61412722014-09-08 14:08:45 +02002 * Copyright (C) 2013 Altera Corporation <www.altera.com>
Chin Liang See70fa4e72013-09-11 11:24:48 -05003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <asm/io.h>
9#include <asm/arch/system_manager.h>
Marek Vasut61412722014-09-08 14:08:45 +020010#include <asm/arch/fpga_manager.h>
Chin Liang See70fa4e72013-09-11 11:24:48 -050011
12DECLARE_GLOBAL_DATA_PTR;
13
Marek Vasut61412722014-09-08 14:08:45 +020014static struct socfpga_system_manager *sysmgr_regs =
15 (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
16
Chin Liang See70fa4e72013-09-11 11:24:48 -050017/*
18 * Configure all the pin muxes
19 */
20void sysmgr_pinmux_init(void)
21{
Marek Vasut61412722014-09-08 14:08:45 +020022 uint32_t regs = (uint32_t)&sysmgr_regs->emacio[0];
23 int i;
Chin Liang See70fa4e72013-09-11 11:24:48 -050024
Marek Vasut61412722014-09-08 14:08:45 +020025 for (i = 0; i < ARRAY_SIZE(sys_mgr_init_table); i++) {
26 writel(sys_mgr_init_table[i], regs);
27 regs += sizeof(regs);
Chin Liang See70fa4e72013-09-11 11:24:48 -050028 }
29}