Marek Vasut | 575d741 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 1 | /* |
| 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 Vasut | f6badb0d | 2015-08-10 21:21:07 +0200 | [diff] [blame] | 10 | |
| 11 | /* Board-specific header. */ |
| 12 | #include <qts/iocsr_config.h> |
Marek Vasut | 575d741 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 13 | |
| 14 | int 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 | } |