ot_zhenguo.li | 6bd9d95 | 2023-02-24 13:55:27 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <device/mmio.h> |
| 5 | #include <soc/addressmap.h> |
| 6 | #include <soc/lastbus_v2.h> |
| 7 | |
Yidi Lin | 9fbdb2b | 2023-03-28 10:47:27 +0800 | [diff] [blame^] | 8 | static const struct lastbus_idle_mask infra_ao_mask[] = { |
| 9 | { |
| 10 | .reg_offset = 0x04, |
| 11 | .reg_value = 0x2, |
| 12 | }, |
| 13 | { |
| 14 | .reg_offset = 0x08, |
| 15 | .reg_value = 0x10000, |
| 16 | }, |
| 17 | }; |
| 18 | |
| 19 | static const struct lastbus_idle_mask peri_ao_mask[] = { |
| 20 | { |
| 21 | .reg_offset = 0x04, |
| 22 | .reg_value = 0x20000, |
| 23 | }, |
| 24 | }; |
| 25 | |
| 26 | static const struct lastbus_idle_mask fmem_ao_mask[] = { |
| 27 | { |
| 28 | .reg_offset = 0x14, |
| 29 | .reg_value = 0x204, |
| 30 | }, |
| 31 | }; |
| 32 | |
| 33 | static const struct lastbus_monitor monitors[] = { |
| 34 | { |
| 35 | .name = "debug_ctrl_ao_INFRA_AO", |
| 36 | .base = INFRA_AO_DBUG_BASE, |
| 37 | .num_ports = 34, |
| 38 | .num_idle_mask = ARRAY_SIZE(infra_ao_mask), |
| 39 | .idle_masks = infra_ao_mask, |
| 40 | .bus_freq_mhz = 78, |
| 41 | }, |
| 42 | { |
| 43 | .name = "debug_ctrl_ao_INFRA2_AO", |
| 44 | .base = INFRA2_AO_DBUG_BASE, |
| 45 | .num_ports = 9, |
| 46 | .num_idle_mask = 0, |
| 47 | .bus_freq_mhz = 78, |
| 48 | }, |
| 49 | { |
| 50 | .name = "debug_ctrl_ao_PERI_AO", |
| 51 | .base = PERI_AO_BASE, |
| 52 | .num_ports = 25, |
| 53 | .num_idle_mask = ARRAY_SIZE(peri_ao_mask), |
| 54 | .idle_masks = peri_ao_mask, |
| 55 | .bus_freq_mhz = 78, |
| 56 | }, |
| 57 | { |
| 58 | .name = "debug_ctrl_ao_PERI_AO2", |
| 59 | .base = PERI_AO2_BASE, |
| 60 | .num_ports = 20, |
| 61 | .num_idle_mask = 0, |
| 62 | .bus_freq_mhz = 78, |
| 63 | }, |
| 64 | { |
| 65 | .name = "debug_ctrl_ao_PERI_PAR_AO", |
| 66 | .base = PERI_PAR_AO_BASE, |
| 67 | .num_ports = 18, |
| 68 | .num_idle_mask = 0, |
| 69 | .bus_freq_mhz = 78, |
| 70 | }, |
| 71 | { |
| 72 | .name = "debug_ctrl_ao_FMEM_AO", |
| 73 | .base = FMEM_AO_BASE, |
| 74 | .num_ports = 28, |
| 75 | .num_idle_mask = ARRAY_SIZE(fmem_ao_mask), |
| 76 | .idle_masks = fmem_ao_mask, |
| 77 | .bus_freq_mhz = 78, |
| 78 | }, |
| 79 | }; |
| 80 | |
ot_zhenguo.li | 6bd9d95 | 2023-02-24 13:55:27 +0800 | [diff] [blame] | 81 | const struct lastbus_config lastbus_cfg = { |
| 82 | .latch_platform = "MT8188", |
| 83 | .timeout_ms = 200, |
| 84 | .timeout_type = 0, |
Yidi Lin | 9fbdb2b | 2023-03-28 10:47:27 +0800 | [diff] [blame^] | 85 | .num_used_monitors = ARRAY_SIZE(monitors), |
| 86 | .monitors = monitors, |
ot_zhenguo.li | 6bd9d95 | 2023-02-24 13:55:27 +0800 | [diff] [blame] | 87 | }; |