15
15
16
16
#include "clk-aspeed.h"
17
17
18
- #define ASPEED_G6_NUM_CLKS 67
18
+ #define ASPEED_G6_NUM_CLKS 71
19
19
20
20
#define ASPEED_G6_SILICON_REV 0x004
21
21
40
40
41
41
#define ASPEED_G6_STRAP1 0x500
42
42
43
+ #define ASPEED_MAC12_CLK_DLY 0x340
44
+ #define ASPEED_MAC34_CLK_DLY 0x350
45
+
43
46
/* Globally visible clocks */
44
47
static DEFINE_SPINLOCK (aspeed_g6_clk_lock );
45
48
@@ -485,6 +488,11 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev)
485
488
return PTR_ERR (hw );
486
489
aspeed_g6_clk_data -> hws [ASPEED_CLK_SDIO ] = hw ;
487
490
491
+ /* MAC1/2 RMII 50MHz RCLK */
492
+ hw = clk_hw_register_fixed_rate (dev , "mac12rclk" , "hpll" , 0 , 50000000 );
493
+ if (IS_ERR (hw ))
494
+ return PTR_ERR (hw );
495
+
488
496
/* MAC1/2 AHB bus clock divider */
489
497
hw = clk_hw_register_divider_table (dev , "mac12" , "hpll" , 0 ,
490
498
scu_g6_base + ASPEED_G6_CLK_SELECTION1 , 16 , 3 , 0 ,
@@ -494,6 +502,27 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev)
494
502
return PTR_ERR (hw );
495
503
aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC12 ] = hw ;
496
504
505
+ /* RMII1 50MHz (RCLK) output enable */
506
+ hw = clk_hw_register_gate (dev , "mac1rclk" , "mac12rclk" , 0 ,
507
+ scu_g6_base + ASPEED_MAC12_CLK_DLY , 29 , 0 ,
508
+ & aspeed_g6_clk_lock );
509
+ if (IS_ERR (hw ))
510
+ return PTR_ERR (hw );
511
+ aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC1RCLK ] = hw ;
512
+
513
+ /* RMII2 50MHz (RCLK) output enable */
514
+ hw = clk_hw_register_gate (dev , "mac2rclk" , "mac12rclk" , 0 ,
515
+ scu_g6_base + ASPEED_MAC12_CLK_DLY , 30 , 0 ,
516
+ & aspeed_g6_clk_lock );
517
+ if (IS_ERR (hw ))
518
+ return PTR_ERR (hw );
519
+ aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC2RCLK ] = hw ;
520
+
521
+ /* MAC1/2 RMII 50MHz RCLK */
522
+ hw = clk_hw_register_fixed_rate (dev , "mac34rclk" , "hclk" , 0 , 50000000 );
523
+ if (IS_ERR (hw ))
524
+ return PTR_ERR (hw );
525
+
497
526
/* MAC3/4 AHB bus clock divider */
498
527
hw = clk_hw_register_divider_table (dev , "mac34" , "hpll" , 0 ,
499
528
scu_g6_base + 0x310 , 24 , 3 , 0 ,
@@ -503,6 +532,22 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev)
503
532
return PTR_ERR (hw );
504
533
aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC34 ] = hw ;
505
534
535
+ /* RMII3 50MHz (RCLK) output enable */
536
+ hw = clk_hw_register_gate (dev , "mac3rclk" , "mac34rclk" , 0 ,
537
+ scu_g6_base + ASPEED_MAC34_CLK_DLY , 29 , 0 ,
538
+ & aspeed_g6_clk_lock );
539
+ if (IS_ERR (hw ))
540
+ return PTR_ERR (hw );
541
+ aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC3RCLK ] = hw ;
542
+
543
+ /* RMII4 50MHz (RCLK) output enable */
544
+ hw = clk_hw_register_gate (dev , "mac4rclk" , "mac34rclk" , 0 ,
545
+ scu_g6_base + ASPEED_MAC34_CLK_DLY , 30 , 0 ,
546
+ & aspeed_g6_clk_lock );
547
+ if (IS_ERR (hw ))
548
+ return PTR_ERR (hw );
549
+ aspeed_g6_clk_data -> hws [ASPEED_CLK_MAC4RCLK ] = hw ;
550
+
506
551
/* LPC Host (LHCLK) clock divider */
507
552
hw = clk_hw_register_divider_table (dev , "lhclk" , "hpll" , 0 ,
508
553
scu_g6_base + ASPEED_G6_CLK_SELECTION1 , 20 , 3 , 0 ,
0 commit comments