|
12 | 12 | #include "ivpu_mmu.h" |
13 | 13 | #include "ivpu_pm.h" |
14 | 14 |
|
15 | | -#define TILE_FUSE_ENABLE_BOTH 0x0 |
16 | | -#define TILE_FUSE_ENABLE_UPPER 0x1 |
17 | | -#define TILE_FUSE_ENABLE_LOWER 0x2 |
18 | | - |
19 | | -#define TILE_SKU_BOTH_MTL 0x3630 |
20 | | -#define TILE_SKU_LOWER_MTL 0x3631 |
21 | | -#define TILE_SKU_UPPER_MTL 0x3632 |
| 15 | +#define TILE_FUSE_ENABLE_BOTH 0x0 |
| 16 | +#define TILE_SKU_BOTH_MTL 0x3630 |
22 | 17 |
|
23 | 18 | /* Work point configuration values */ |
24 | | -#define WP_CONFIG_1_TILE_5_3_RATIO 0x0101 |
25 | | -#define WP_CONFIG_1_TILE_4_3_RATIO 0x0102 |
26 | | -#define WP_CONFIG_2_TILE_5_3_RATIO 0x0201 |
27 | | -#define WP_CONFIG_2_TILE_4_3_RATIO 0x0202 |
28 | | -#define WP_CONFIG_0_TILE_PLL_OFF 0x0000 |
| 19 | +#define CONFIG_1_TILE 0x01 |
| 20 | +#define CONFIG_2_TILE 0x02 |
| 21 | +#define PLL_RATIO_5_3 0x01 |
| 22 | +#define PLL_RATIO_4_3 0x02 |
| 23 | +#define WP_CONFIG(tile, ratio) (((tile) << 8) | (ratio)) |
| 24 | +#define WP_CONFIG_1_TILE_5_3_RATIO WP_CONFIG(CONFIG_1_TILE, PLL_RATIO_5_3) |
| 25 | +#define WP_CONFIG_1_TILE_4_3_RATIO WP_CONFIG(CONFIG_1_TILE, PLL_RATIO_4_3) |
| 26 | +#define WP_CONFIG_2_TILE_5_3_RATIO WP_CONFIG(CONFIG_2_TILE, PLL_RATIO_5_3) |
| 27 | +#define WP_CONFIG_2_TILE_4_3_RATIO WP_CONFIG(CONFIG_2_TILE, PLL_RATIO_4_3) |
| 28 | +#define WP_CONFIG_0_TILE_PLL_OFF WP_CONFIG(0, 0) |
29 | 29 |
|
30 | 30 | #define PLL_REF_CLK_FREQ (50 * 1000000) |
31 | 31 | #define PLL_SIMULATION_FREQ (10 * 1000000) |
@@ -219,7 +219,8 @@ static int ivpu_pll_drive(struct ivpu_device *vdev, bool enable) |
219 | 219 | config = 0; |
220 | 220 | } |
221 | 221 |
|
222 | | - ivpu_dbg(vdev, PM, "PLL workpoint request: %d Hz\n", PLL_RATIO_TO_FREQ(target_ratio)); |
| 222 | + ivpu_dbg(vdev, PM, "PLL workpoint request: config 0x%04x pll ratio 0x%x\n", |
| 223 | + config, target_ratio); |
223 | 224 |
|
224 | 225 | ret = ivpu_pll_cmd_send(vdev, hw->pll.min_ratio, hw->pll.max_ratio, target_ratio, config); |
225 | 226 | if (ret) { |
@@ -610,34 +611,10 @@ static int ivpu_boot_d0i3_drive(struct ivpu_device *vdev, bool enable) |
610 | 611 | static int ivpu_hw_mtl_info_init(struct ivpu_device *vdev) |
611 | 612 | { |
612 | 613 | struct ivpu_hw_info *hw = vdev->hw; |
613 | | - u32 tile_fuse; |
614 | | - |
615 | | - tile_fuse = REGB_RD32(MTL_BUTTRESS_TILE_FUSE); |
616 | | - if (!REG_TEST_FLD(MTL_BUTTRESS_TILE_FUSE, VALID, tile_fuse)) |
617 | | - ivpu_warn(vdev, "Tile Fuse: Invalid (0x%x)\n", tile_fuse); |
618 | | - |
619 | | - hw->tile_fuse = REG_GET_FLD(MTL_BUTTRESS_TILE_FUSE, SKU, tile_fuse); |
620 | | - switch (hw->tile_fuse) { |
621 | | - case TILE_FUSE_ENABLE_LOWER: |
622 | | - hw->sku = TILE_SKU_LOWER_MTL; |
623 | | - hw->config = WP_CONFIG_1_TILE_5_3_RATIO; |
624 | | - ivpu_dbg(vdev, MISC, "Tile Fuse: Enable Lower\n"); |
625 | | - break; |
626 | | - case TILE_FUSE_ENABLE_UPPER: |
627 | | - hw->sku = TILE_SKU_UPPER_MTL; |
628 | | - hw->config = WP_CONFIG_1_TILE_4_3_RATIO; |
629 | | - ivpu_dbg(vdev, MISC, "Tile Fuse: Enable Upper\n"); |
630 | | - break; |
631 | | - case TILE_FUSE_ENABLE_BOTH: |
632 | | - hw->sku = TILE_SKU_BOTH_MTL; |
633 | | - hw->config = WP_CONFIG_2_TILE_5_3_RATIO; |
634 | | - ivpu_dbg(vdev, MISC, "Tile Fuse: Enable Both\n"); |
635 | | - break; |
636 | | - default: |
637 | | - hw->config = WP_CONFIG_0_TILE_PLL_OFF; |
638 | | - ivpu_dbg(vdev, MISC, "Tile Fuse: Disable\n"); |
639 | | - break; |
640 | | - } |
| 614 | + |
| 615 | + hw->tile_fuse = TILE_FUSE_ENABLE_BOTH; |
| 616 | + hw->sku = TILE_SKU_BOTH_MTL; |
| 617 | + hw->config = WP_CONFIG_2_TILE_4_3_RATIO; |
641 | 618 |
|
642 | 619 | ivpu_pll_init_frequency_ratios(vdev); |
643 | 620 |
|
|
0 commit comments