Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Marek Vasut <marex@denx.de> |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 6 | #include <config.h> |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 7 | #include <errno.h> |
| 8 | #include <asm/arch/clock_manager.h> |
Marek Vasut | 372f70d | 2015-08-10 21:21:07 +0200 | [diff] [blame] | 9 | |
| 10 | /* Board-specific header. */ |
| 11 | #include <qts/iocsr_config.h> |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 12 | |
| 13 | int iocsr_get_config_table(const unsigned int chain_id, |
| 14 | const unsigned long **table, |
| 15 | unsigned int *table_len) |
| 16 | { |
| 17 | switch (chain_id) { |
| 18 | case 0: |
| 19 | *table = iocsr_scan_chain0_table; |
Tom Rini | dcdd3bd | 2022-10-28 20:27:14 -0400 | [diff] [blame] | 20 | *table_len = CFG_HPS_IOCSR_SCANCHAIN0_LENGTH; |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 21 | break; |
| 22 | case 1: |
| 23 | *table = iocsr_scan_chain1_table; |
Tom Rini | dcdd3bd | 2022-10-28 20:27:14 -0400 | [diff] [blame] | 24 | *table_len = CFG_HPS_IOCSR_SCANCHAIN1_LENGTH; |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 25 | break; |
| 26 | case 2: |
| 27 | *table = iocsr_scan_chain2_table; |
Tom Rini | dcdd3bd | 2022-10-28 20:27:14 -0400 | [diff] [blame] | 28 | *table_len = CFG_HPS_IOCSR_SCANCHAIN2_LENGTH; |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 29 | break; |
| 30 | case 3: |
| 31 | *table = iocsr_scan_chain3_table; |
Tom Rini | dcdd3bd | 2022-10-28 20:27:14 -0400 | [diff] [blame] | 32 | *table_len = CFG_HPS_IOCSR_SCANCHAIN3_LENGTH; |
Marek Vasut | 9c3e006 | 2015-07-25 09:53:23 +0200 | [diff] [blame] | 33 | break; |
| 34 | default: |
| 35 | return -EINVAL; |
| 36 | } |
| 37 | |
| 38 | return 0; |
| 39 | } |