diff options
author | Marek Vasut <marex@denx.de> | 2015-07-25 11:09:11 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-08-08 14:14:07 +0200 |
commit | 2d779b39b4e11c4db7a2796af76051e70a556c5f (patch) | |
tree | 3109aa74539f3a8303886bf876e919ef86eecd2f /arch/arm/mach-socfpga | |
parent | 40687b4f468c357d3821454099020949a10d759e (diff) |
arm: socfpga: system: Clean up pinmux_config.c
Implement new accessor, sysmgr_get_pinmux_table(), used to obtain pinmux
table and it's size from the QTS-generated pinmux_config.c. The target
here is again to get rid of poluting global namespace by including the
pinmux_config.h into it.
Furthermore, the pinmux_config.h declares some CONFIG_HPS_* macros,
which are explicitly useless to us in U-Boot. Instead, U-Boot does
use DT to detect exactly these configuration options. This patch
makes sure that while this QTS-generated file can stay in the tree,
these obscure macros do not ooze into the namespace anymore.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'arch/arm/mach-socfpga')
-rw-r--r-- | arch/arm/mach-socfpga/include/mach/system_manager.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-socfpga/system_manager.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-socfpga/include/mach/system_manager.h b/arch/arm/mach-socfpga/include/mach/system_manager.h index de05aaf198..46af30b640 100644 --- a/arch/arm/mach-socfpga/include/mach/system_manager.h +++ b/arch/arm/mach-socfpga/include/mach/system_manager.h @@ -12,9 +12,8 @@ void sysmgr_pinmux_init(void); void sysmgr_config_warmrstcfgio(int enable); -/* declaration for handoff table type */ -extern unsigned long sys_mgr_init_table[CONFIG_HPS_PINMUX_NUM]; - +void sysmgr_get_pinmux_table(const unsigned long **table, + unsigned int *table_len); #endif struct socfpga_system_manager { diff --git a/arch/arm/mach-socfpga/system_manager.c b/arch/arm/mach-socfpga/system_manager.c index 5ed47c3cff..744ec326b4 100644 --- a/arch/arm/mach-socfpga/system_manager.c +++ b/arch/arm/mach-socfpga/system_manager.c @@ -57,9 +57,13 @@ static void populate_sysmgr_fpgaintf_module(void) void sysmgr_pinmux_init(void) { uint32_t regs = (uint32_t)&sysmgr_regs->emacio[0]; + const unsigned long *sys_mgr_init_table; + unsigned int len; int i; - for (i = 0; i < ARRAY_SIZE(sys_mgr_init_table); i++) { + sysmgr_get_pinmux_table(&sys_mgr_init_table, &len); + + for (i = 0; i < len; i++) { writel(sys_mgr_init_table[i], regs); regs += sizeof(regs); } |