|
14 | 14 |
|
15 | 15 | #include "clk-aspeed.h"
|
16 | 16 |
|
17 |
| -#define ASPEED_NUM_CLKS 36 |
| 17 | +#define ASPEED_NUM_CLKS 38 |
18 | 18 |
|
19 | 19 | #define ASPEED_RESET2_OFFSET 32
|
20 | 20 |
|
|
28 | 28 | #define AST2400_HPLL_BYPASS_EN BIT(17)
|
29 | 29 | #define ASPEED_MISC_CTRL 0x2c
|
30 | 30 | #define UART_DIV13_EN BIT(12)
|
| 31 | +#define ASPEED_MAC_CLK_DLY 0x48 |
31 | 32 | #define ASPEED_STRAP 0x70
|
32 | 33 | #define CLKIN_25MHZ_EN BIT(23)
|
33 | 34 | #define AST2400_CLK_SOURCE_SEL BIT(18)
|
@@ -462,6 +463,30 @@ static int aspeed_clk_probe(struct platform_device *pdev)
|
462 | 463 | return PTR_ERR(hw);
|
463 | 464 | aspeed_clk_data->hws[ASPEED_CLK_MAC] = hw;
|
464 | 465 |
|
| 466 | + if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2500-scu")) { |
| 467 | + /* RMII 50MHz RCLK */ |
| 468 | + hw = clk_hw_register_fixed_rate(dev, "mac12rclk", "hpll", 0, |
| 469 | + 50000000); |
| 470 | + if (IS_ERR(hw)) |
| 471 | + return PTR_ERR(hw); |
| 472 | + |
| 473 | + /* RMII1 50MHz (RCLK) output enable */ |
| 474 | + hw = clk_hw_register_gate(dev, "mac1rclk", "mac12rclk", 0, |
| 475 | + scu_base + ASPEED_MAC_CLK_DLY, 29, 0, |
| 476 | + &aspeed_clk_lock); |
| 477 | + if (IS_ERR(hw)) |
| 478 | + return PTR_ERR(hw); |
| 479 | + aspeed_clk_data->hws[ASPEED_CLK_MAC1RCLK] = hw; |
| 480 | + |
| 481 | + /* RMII2 50MHz (RCLK) output enable */ |
| 482 | + hw = clk_hw_register_gate(dev, "mac2rclk", "mac12rclk", 0, |
| 483 | + scu_base + ASPEED_MAC_CLK_DLY, 30, 0, |
| 484 | + &aspeed_clk_lock); |
| 485 | + if (IS_ERR(hw)) |
| 486 | + return PTR_ERR(hw); |
| 487 | + aspeed_clk_data->hws[ASPEED_CLK_MAC2RCLK] = hw; |
| 488 | + } |
| 489 | + |
465 | 490 | /* LPC Host (LHCLK) clock divider */
|
466 | 491 | hw = clk_hw_register_divider_table(dev, "lhclk", "hpll", 0,
|
467 | 492 | scu_base + ASPEED_CLK_SELECTION, 20, 3, 0,
|
|
0 commit comments