blob: 5e3f0573555c605817e14abe4fed3abed2f22adb [file] [log] [blame]
Marek Vasut575d7412015-07-25 09:53:23 +02001/*
2 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <errno.h>
9#include <asm/arch/clock_manager.h>
Marek Vasutf6badb0d2015-08-10 21:21:07 +020010
11/* Board-specific header. */
12#include <qts/iocsr_config.h>
Marek Vasut575d7412015-07-25 09:53:23 +020013
14int iocsr_get_config_table(const unsigned int chain_id,
15 const unsigned long **table,
16 unsigned int *table_len)
17{
18 switch (chain_id) {
19 case 0:
20 *table = iocsr_scan_chain0_table;
21 *table_len = CONFIG_HPS_IOCSR_SCANCHAIN0_LENGTH;
22 break;
23 case 1:
24 *table = iocsr_scan_chain1_table;
25 *table_len = CONFIG_HPS_IOCSR_SCANCHAIN1_LENGTH;
26 break;
27 case 2:
28 *table = iocsr_scan_chain2_table;
29 *table_len = CONFIG_HPS_IOCSR_SCANCHAIN2_LENGTH;
30 break;
31 case 3:
32 *table = iocsr_scan_chain3_table;
33 *table_len = CONFIG_HPS_IOCSR_SCANCHAIN3_LENGTH;
34 break;
35 default:
36 return -EINVAL;
37 }
38
39 return 0;
40}