Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 1 | /* |
Marek Vasut | 6141272 | 2014-09-08 14:08:45 +0200 | [diff] [blame^] | 2 | * Copyright (C) 2013 Altera Corporation <www.altera.com> |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 3 | * |
| 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 Vasut | 6141272 | 2014-09-08 14:08:45 +0200 | [diff] [blame^] | 10 | #include <asm/arch/fpga_manager.h> |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 11 | |
| 12 | DECLARE_GLOBAL_DATA_PTR; |
| 13 | |
Marek Vasut | 6141272 | 2014-09-08 14:08:45 +0200 | [diff] [blame^] | 14 | static struct socfpga_system_manager *sysmgr_regs = |
| 15 | (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS; |
| 16 | |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 17 | /* |
| 18 | * Configure all the pin muxes |
| 19 | */ |
| 20 | void sysmgr_pinmux_init(void) |
| 21 | { |
Marek Vasut | 6141272 | 2014-09-08 14:08:45 +0200 | [diff] [blame^] | 22 | uint32_t regs = (uint32_t)&sysmgr_regs->emacio[0]; |
| 23 | int i; |
Chin Liang See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 24 | |
Marek Vasut | 6141272 | 2014-09-08 14:08:45 +0200 | [diff] [blame^] | 25 | 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 See | 70fa4e7 | 2013-09-11 11:24:48 -0500 | [diff] [blame] | 28 | } |
| 29 | } |