Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sunxi-clk-for-3.15' of https://bitbucket.org/emiliolopez/linux into clk-next-sunxi

Allwinner sunXi SoCs clock changes

This adds support for the new, more correct clock node naming and gets
the A10 compatibles in line with the rest of the other SoCs. It also
adds support for the USB, GMAC and A31's PLL6 clocks. Some of these
changes also require DT modifications that will be merged via arm-soc.

+344 -48
+79 -23
Documentation/devicetree/bindings/clock/sunxi.txt
··· 6 6 7 7 Required properties: 8 8 - compatible : shall be one of the following: 9 - "allwinner,sun4i-osc-clk" - for a gatable oscillator 10 - "allwinner,sun4i-pll1-clk" - for the main PLL clock and PLL4 9 + "allwinner,sun4i-a10-osc-clk" - for a gatable oscillator 10 + "allwinner,sun4i-a10-pll1-clk" - for the main PLL clock and PLL4 11 11 "allwinner,sun6i-a31-pll1-clk" - for the main PLL clock on A31 12 - "allwinner,sun4i-pll5-clk" - for the PLL5 clock 13 - "allwinner,sun4i-pll6-clk" - for the PLL6 clock 14 - "allwinner,sun4i-cpu-clk" - for the CPU multiplexer clock 15 - "allwinner,sun4i-axi-clk" - for the AXI clock 16 - "allwinner,sun4i-axi-gates-clk" - for the AXI gates 17 - "allwinner,sun4i-ahb-clk" - for the AHB clock 18 - "allwinner,sun4i-ahb-gates-clk" - for the AHB gates on A10 12 + "allwinner,sun4i-a10-pll5-clk" - for the PLL5 clock 13 + "allwinner,sun4i-a10-pll6-clk" - for the PLL6 clock 14 + "allwinner,sun6i-a31-pll6-clk" - for the PLL6 clock on A31 15 + "allwinner,sun4i-a10-cpu-clk" - for the CPU multiplexer clock 16 + "allwinner,sun4i-a10-axi-clk" - for the AXI clock 17 + "allwinner,sun4i-a10-axi-gates-clk" - for the AXI gates 18 + "allwinner,sun4i-a10-ahb-clk" - for the AHB clock 19 + "allwinner,sun4i-a10-ahb-gates-clk" - for the AHB gates on A10 19 20 "allwinner,sun5i-a13-ahb-gates-clk" - for the AHB gates on A13 20 21 "allwinner,sun5i-a10s-ahb-gates-clk" - for the AHB gates on A10s 21 22 "allwinner,sun7i-a20-ahb-gates-clk" - for the AHB gates on A20 22 23 "allwinner,sun6i-a31-ahb1-mux-clk" - for the AHB1 multiplexer on A31 23 24 "allwinner,sun6i-a31-ahb1-gates-clk" - for the AHB1 gates on A31 24 - "allwinner,sun4i-apb0-clk" - for the APB0 clock 25 - "allwinner,sun4i-apb0-gates-clk" - for the APB0 gates on A10 25 + "allwinner,sun4i-a10-apb0-clk" - for the APB0 clock 26 + "allwinner,sun4i-a10-apb0-gates-clk" - for the APB0 gates on A10 26 27 "allwinner,sun5i-a13-apb0-gates-clk" - for the APB0 gates on A13 27 28 "allwinner,sun5i-a10s-apb0-gates-clk" - for the APB0 gates on A10s 28 29 "allwinner,sun7i-a20-apb0-gates-clk" - for the APB0 gates on A20 29 - "allwinner,sun4i-apb1-clk" - for the APB1 clock 30 - "allwinner,sun4i-apb1-mux-clk" - for the APB1 clock muxing 31 - "allwinner,sun4i-apb1-gates-clk" - for the APB1 gates on A10 30 + "allwinner,sun4i-a10-apb1-clk" - for the APB1 clock 31 + "allwinner,sun4i-a10-apb1-mux-clk" - for the APB1 clock muxing 32 + "allwinner,sun4i-a10-apb1-gates-clk" - for the APB1 gates on A10 32 33 "allwinner,sun5i-a13-apb1-gates-clk" - for the APB1 gates on A13 33 34 "allwinner,sun5i-a10s-apb1-gates-clk" - for the APB1 gates on A10s 34 35 "allwinner,sun6i-a31-apb1-gates-clk" - for the APB1 gates on A31 35 36 "allwinner,sun7i-a20-apb1-gates-clk" - for the APB1 gates on A20 36 37 "allwinner,sun6i-a31-apb2-div-clk" - for the APB2 gates on A31 37 38 "allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31 38 - "allwinner,sun4i-mod0-clk" - for the module 0 family of clocks 39 + "allwinner,sun4i-a10-mod0-clk" - for the module 0 family of clocks 39 40 "allwinner,sun7i-a20-out-clk" - for the external output clocks 41 + "allwinner,sun7i-a20-gmac-clk" - for the GMAC clock module on A20/A31 42 + "allwinner,sun4i-a10-usb-clk" - for usb gates + resets on A10 / A20 43 + "allwinner,sun5i-a13-usb-clk" - for usb gates + resets on A13 40 44 41 45 Required properties for all clocks: 42 46 - reg : shall be the control register address for the clock. ··· 48 44 multiplexed clocks, the list order must match the hardware 49 45 programming order. 50 46 - #clock-cells : from common clock binding; shall be set to 0 except for 51 - "allwinner,*-gates-clk" where it shall be set to 1 47 + "allwinner,*-gates-clk", "allwinner,sun4i-pll5-clk" and 48 + "allwinner,sun4i-pll6-clk" where it shall be set to 1 49 + - clock-output-names : shall be the corresponding names of the outputs. 50 + If the clock module only has one output, the name shall be the 51 + module name. 52 52 53 - Additionally, "allwinner,*-gates-clk" clocks require: 54 - - clock-output-names : the corresponding gate names that the clock controls 53 + And "allwinner,*-usb-clk" clocks also require: 54 + - reset-cells : shall be set to 1 55 + 56 + For "allwinner,sun7i-a20-gmac-clk", the parent clocks shall be fixed rate 57 + dummy clocks at 25 MHz and 125 MHz, respectively. See example. 55 58 56 59 Clock consumers should specify the desired clocks they use with a 57 60 "clocks" phandle cell. Consumers that are using a gated clock should ··· 67 56 68 57 For example: 69 58 70 - osc24M: osc24M@01c20050 { 59 + osc24M: clk@01c20050 { 71 60 #clock-cells = <0>; 72 - compatible = "allwinner,sun4i-osc-clk"; 61 + compatible = "allwinner,sun4i-a10-osc-clk"; 73 62 reg = <0x01c20050 0x4>; 74 63 clocks = <&osc24M_fixed>; 64 + clock-output-names = "osc24M"; 75 65 }; 76 66 77 - pll1: pll1@01c20000 { 67 + pll1: clk@01c20000 { 78 68 #clock-cells = <0>; 79 - compatible = "allwinner,sun4i-pll1-clk"; 69 + compatible = "allwinner,sun4i-a10-pll1-clk"; 80 70 reg = <0x01c20000 0x4>; 81 71 clocks = <&osc24M>; 72 + clock-output-names = "pll1"; 73 + }; 74 + 75 + pll5: clk@01c20020 { 76 + #clock-cells = <1>; 77 + compatible = "allwinner,sun4i-pll5-clk"; 78 + reg = <0x01c20020 0x4>; 79 + clocks = <&osc24M>; 80 + clock-output-names = "pll5_ddr", "pll5_other"; 82 81 }; 83 82 84 83 cpu: cpu@01c20054 { 85 84 #clock-cells = <0>; 86 - compatible = "allwinner,sun4i-cpu-clk"; 85 + compatible = "allwinner,sun4i-a10-cpu-clk"; 87 86 reg = <0x01c20054 0x4>; 88 87 clocks = <&osc32k>, <&osc24M>, <&pll1>; 88 + clock-output-names = "cpu"; 89 + }; 90 + 91 + mmc0_clk: clk@01c20088 { 92 + #clock-cells = <0>; 93 + compatible = "allwinner,sun4i-mod0-clk"; 94 + reg = <0x01c20088 0x4>; 95 + clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 96 + clock-output-names = "mmc0"; 97 + }; 98 + 99 + mii_phy_tx_clk: clk@2 { 100 + #clock-cells = <0>; 101 + compatible = "fixed-clock"; 102 + clock-frequency = <25000000>; 103 + clock-output-names = "mii_phy_tx"; 104 + }; 105 + 106 + gmac_int_tx_clk: clk@3 { 107 + #clock-cells = <0>; 108 + compatible = "fixed-clock"; 109 + clock-frequency = <125000000>; 110 + clock-output-names = "gmac_int_tx"; 111 + }; 112 + 113 + gmac_clk: clk@01c20164 { 114 + #clock-cells = <0>; 115 + compatible = "allwinner,sun7i-a20-gmac-clk"; 116 + reg = <0x01c20164 0x4>; 117 + /* 118 + * The first clock must be fixed at 25MHz; 119 + * the second clock must be fixed at 125MHz 120 + */ 121 + clocks = <&mii_phy_tx_clk>, <&gmac_int_tx_clk>; 122 + clock-output-names = "gmac"; 89 123 };
+265 -25
drivers/clk/sunxi/clk-sunxi.c
··· 18 18 #include <linux/clkdev.h> 19 19 #include <linux/of.h> 20 20 #include <linux/of_address.h> 21 + #include <linux/reset-controller.h> 21 22 22 23 #include "clk-factors.h" 23 24 ··· 52 51 if (!gate) 53 52 goto err_free_fixed; 54 53 54 + of_property_read_string(node, "clock-output-names", &clk_name); 55 + 55 56 /* set up gate and fixed rate properties */ 56 57 gate->reg = of_iomap(node, 0); 57 58 gate->bit_idx = SUNXI_OSC24M_GATE; ··· 80 77 err_free_fixed: 81 78 kfree(fixed); 82 79 } 83 - CLK_OF_DECLARE(sun4i_osc, "allwinner,sun4i-osc-clk", sun4i_osc_clk_setup); 80 + CLK_OF_DECLARE(sun4i_osc, "allwinner,sun4i-a10-osc-clk", sun4i_osc_clk_setup); 84 81 85 82 86 83 ··· 252 249 *n = DIV_ROUND_UP(div, (*k+1)); 253 250 } 254 251 252 + /** 253 + * sun6i_a31_get_pll6_factors() - calculates n, k factors for A31 PLL6 254 + * PLL6 rate is calculated as follows 255 + * rate = parent_rate * n * (k + 1) / 2 256 + * parent_rate is always 24Mhz 257 + */ 255 258 259 + static void sun6i_a31_get_pll6_factors(u32 *freq, u32 parent_rate, 260 + u8 *n, u8 *k, u8 *m, u8 *p) 261 + { 262 + u8 div; 263 + 264 + /* 265 + * We always have 24MHz / 2, so we can just say that our 266 + * parent clock is 12MHz. 267 + */ 268 + parent_rate = parent_rate / 2; 269 + 270 + /* Normalize value to a parent_rate multiple (24M / 2) */ 271 + div = *freq / parent_rate; 272 + *freq = parent_rate * div; 273 + 274 + /* we were called to round the frequency, we can now return */ 275 + if (n == NULL) 276 + return; 277 + 278 + *k = div / 32; 279 + if (*k > 3) 280 + *k = 3; 281 + 282 + *n = DIV_ROUND_UP(div, (*k+1)); 283 + } 256 284 257 285 /** 258 286 * sun4i_get_apb1_factors() - calculates m, p factors for APB1 ··· 411 377 412 378 413 379 /** 380 + * sun7i_a20_gmac_clk_setup - Setup function for A20/A31 GMAC clock module 381 + * 382 + * This clock looks something like this 383 + * ________________________ 384 + * MII TX clock from PHY >-----|___________ _________|----> to GMAC core 385 + * GMAC Int. RGMII TX clk >----|___________\__/__gate---|----> to PHY 386 + * Ext. 125MHz RGMII TX clk >--|__divider__/ | 387 + * |________________________| 388 + * 389 + * The external 125 MHz reference is optional, i.e. GMAC can use its 390 + * internal TX clock just fine. The A31 GMAC clock module does not have 391 + * the divider controls for the external reference. 392 + * 393 + * To keep it simple, let the GMAC use either the MII TX clock for MII mode, 394 + * and its internal TX clock for GMII and RGMII modes. The GMAC driver should 395 + * select the appropriate source and gate/ungate the output to the PHY. 396 + * 397 + * Only the GMAC should use this clock. Altering the clock so that it doesn't 398 + * match the GMAC's operation parameters will result in the GMAC not being 399 + * able to send traffic out. The GMAC driver should set the clock rate and 400 + * enable/disable this clock to configure the required state. The clock 401 + * driver then responds by auto-reparenting the clock. 402 + */ 403 + 404 + #define SUN7I_A20_GMAC_GPIT 2 405 + #define SUN7I_A20_GMAC_MASK 0x3 406 + #define SUN7I_A20_GMAC_PARENTS 2 407 + 408 + static void __init sun7i_a20_gmac_clk_setup(struct device_node *node) 409 + { 410 + struct clk *clk; 411 + struct clk_mux *mux; 412 + struct clk_gate *gate; 413 + const char *clk_name = node->name; 414 + const char *parents[SUN7I_A20_GMAC_PARENTS]; 415 + void *reg; 416 + 417 + if (of_property_read_string(node, "clock-output-names", &clk_name)) 418 + return; 419 + 420 + /* allocate mux and gate clock structs */ 421 + mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL); 422 + if (!mux) 423 + return; 424 + 425 + gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL); 426 + if (!gate) 427 + goto free_mux; 428 + 429 + /* gmac clock requires exactly 2 parents */ 430 + parents[0] = of_clk_get_parent_name(node, 0); 431 + parents[1] = of_clk_get_parent_name(node, 1); 432 + if (!parents[0] || !parents[1]) 433 + goto free_gate; 434 + 435 + reg = of_iomap(node, 0); 436 + if (!reg) 437 + goto free_gate; 438 + 439 + /* set up gate and fixed rate properties */ 440 + gate->reg = reg; 441 + gate->bit_idx = SUN7I_A20_GMAC_GPIT; 442 + gate->lock = &clk_lock; 443 + mux->reg = reg; 444 + mux->mask = SUN7I_A20_GMAC_MASK; 445 + mux->flags = CLK_MUX_INDEX_BIT; 446 + mux->lock = &clk_lock; 447 + 448 + clk = clk_register_composite(NULL, clk_name, 449 + parents, SUN7I_A20_GMAC_PARENTS, 450 + &mux->hw, &clk_mux_ops, 451 + NULL, NULL, 452 + &gate->hw, &clk_gate_ops, 453 + 0); 454 + 455 + if (IS_ERR(clk)) 456 + goto iounmap_reg; 457 + 458 + of_clk_add_provider(node, of_clk_src_simple_get, clk); 459 + clk_register_clkdev(clk, clk_name, NULL); 460 + 461 + return; 462 + 463 + iounmap_reg: 464 + iounmap(reg); 465 + free_gate: 466 + kfree(gate); 467 + free_mux: 468 + kfree(mux); 469 + } 470 + CLK_OF_DECLARE(sun7i_a20_gmac, "allwinner,sun7i-a20-gmac-clk", 471 + sun7i_a20_gmac_clk_setup); 472 + 473 + 474 + 475 + /** 414 476 * sunxi_factors_clk_setup() - Setup function for factor clocks 415 477 */ 416 478 ··· 517 387 int mux; 518 388 struct clk_factors_config *table; 519 389 void (*getter) (u32 *rate, u32 parent_rate, u8 *n, u8 *k, u8 *m, u8 *p); 390 + const char *name; 520 391 }; 521 392 522 393 static struct clk_factors_config sun4i_pll1_config = { ··· 542 411 543 412 static struct clk_factors_config sun4i_pll5_config = { 544 413 .nshift = 8, 414 + .nwidth = 5, 415 + .kshift = 4, 416 + .kwidth = 2, 417 + }; 418 + 419 + static struct clk_factors_config sun6i_a31_pll6_config = { 420 + .nshift = 8, 545 421 .nwidth = 5, 546 422 .kshift = 4, 547 423 .kwidth = 2, ··· 593 455 .enable = 31, 594 456 .table = &sun4i_pll5_config, 595 457 .getter = sun4i_get_pll5_factors, 458 + .name = "pll5", 459 + }; 460 + 461 + static const struct factors_data sun4i_pll6_data __initconst = { 462 + .enable = 31, 463 + .table = &sun4i_pll5_config, 464 + .getter = sun4i_get_pll5_factors, 465 + .name = "pll6", 466 + }; 467 + 468 + static const struct factors_data sun6i_a31_pll6_data __initconst = { 469 + .enable = 31, 470 + .table = &sun6i_a31_pll6_config, 471 + .getter = sun6i_a31_get_pll6_factors, 596 472 }; 597 473 598 474 static const struct factors_data sun4i_apb1_data __initconst = { ··· 649 497 (parents[i] = of_clk_get_parent_name(node, i)) != NULL) 650 498 i++; 651 499 652 - /* Nodes should be providing the name via clock-output-names 653 - * but originally our dts didn't, and so we used node->name. 654 - * The new, better nodes look like clk@deadbeef, so we pull the 655 - * name just in this case */ 656 - if (!strcmp("clk", clk_name)) { 657 - of_property_read_string_index(node, "clock-output-names", 658 - 0, &clk_name); 659 - } 500 + /* 501 + * some factor clocks, such as pll5 and pll6, may have multiple 502 + * outputs, and have their name designated in factors_data 503 + */ 504 + if (data->name) 505 + clk_name = data->name; 506 + else 507 + of_property_read_string(node, "clock-output-names", &clk_name); 660 508 661 509 factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); 662 510 if (!factors) ··· 753 601 (parents[i] = of_clk_get_parent_name(node, i)) != NULL) 754 602 i++; 755 603 604 + of_property_read_string(node, "clock-output-names", &clk_name); 605 + 756 606 clk = clk_register_mux(NULL, clk_name, parents, i, 757 607 CLK_SET_RATE_NO_REPARENT, reg, 758 608 data->shift, SUNXI_MUX_GATE_WIDTH, ··· 814 660 815 661 clk_parent = of_clk_get_parent_name(node, 0); 816 662 663 + of_property_read_string(node, "clock-output-names", &clk_name); 664 + 817 665 clk = clk_register_divider(NULL, clk_name, clk_parent, 0, 818 666 reg, data->shift, data->width, 819 667 data->pow ? CLK_DIVIDER_POWER_OF_TWO : 0, ··· 829 673 830 674 831 675 /** 676 + * sunxi_gates_reset... - reset bits in leaf gate clk registers handling 677 + */ 678 + 679 + struct gates_reset_data { 680 + void __iomem *reg; 681 + spinlock_t *lock; 682 + struct reset_controller_dev rcdev; 683 + }; 684 + 685 + static int sunxi_gates_reset_assert(struct reset_controller_dev *rcdev, 686 + unsigned long id) 687 + { 688 + struct gates_reset_data *data = container_of(rcdev, 689 + struct gates_reset_data, 690 + rcdev); 691 + unsigned long flags; 692 + u32 reg; 693 + 694 + spin_lock_irqsave(data->lock, flags); 695 + 696 + reg = readl(data->reg); 697 + writel(reg & ~BIT(id), data->reg); 698 + 699 + spin_unlock_irqrestore(data->lock, flags); 700 + 701 + return 0; 702 + } 703 + 704 + static int sunxi_gates_reset_deassert(struct reset_controller_dev *rcdev, 705 + unsigned long id) 706 + { 707 + struct gates_reset_data *data = container_of(rcdev, 708 + struct gates_reset_data, 709 + rcdev); 710 + unsigned long flags; 711 + u32 reg; 712 + 713 + spin_lock_irqsave(data->lock, flags); 714 + 715 + reg = readl(data->reg); 716 + writel(reg | BIT(id), data->reg); 717 + 718 + spin_unlock_irqrestore(data->lock, flags); 719 + 720 + return 0; 721 + } 722 + 723 + static struct reset_control_ops sunxi_gates_reset_ops = { 724 + .assert = sunxi_gates_reset_assert, 725 + .deassert = sunxi_gates_reset_deassert, 726 + }; 727 + 728 + /** 832 729 * sunxi_gates_clk_setup() - Setup function for leaf gates on clocks 833 730 */ 834 731 ··· 889 680 890 681 struct gates_data { 891 682 DECLARE_BITMAP(mask, SUNXI_GATES_MAX_SIZE); 683 + u32 reset_mask; 892 684 }; 893 685 894 686 static const struct gates_data sun4i_axi_gates_data __initconst = { ··· 956 746 .mask = { 0xff80ff }, 957 747 }; 958 748 749 + static const struct gates_data sun4i_a10_usb_gates_data __initconst = { 750 + .mask = {0x1C0}, 751 + .reset_mask = 0x07, 752 + }; 753 + 754 + static const struct gates_data sun5i_a13_usb_gates_data __initconst = { 755 + .mask = {0x140}, 756 + .reset_mask = 0x03, 757 + }; 758 + 959 759 static void __init sunxi_gates_clk_setup(struct device_node *node, 960 760 struct gates_data *data) 961 761 { 962 762 struct clk_onecell_data *clk_data; 763 + struct gates_reset_data *reset_data; 963 764 const char *clk_parent; 964 765 const char *clk_name; 965 766 void *reg; ··· 1014 793 clk_data->clk_num = i; 1015 794 1016 795 of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 796 + 797 + /* Register a reset controler for gates with reset bits */ 798 + if (data->reset_mask == 0) 799 + return; 800 + 801 + reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); 802 + if (!reset_data) 803 + return; 804 + 805 + reset_data->reg = reg; 806 + reset_data->lock = &clk_lock; 807 + reset_data->rcdev.nr_resets = __fls(data->reset_mask) + 1; 808 + reset_data->rcdev.ops = &sunxi_gates_reset_ops; 809 + reset_data->rcdev.of_node = node; 810 + reset_controller_register(&reset_data->rcdev); 1017 811 } 1018 812 1019 813 ··· 1068 832 }; 1069 833 1070 834 static const struct divs_data pll6_divs_data __initconst = { 1071 - .factors = &sun4i_pll5_data, 835 + .factors = &sun4i_pll6_data, 1072 836 .div = { 1073 837 { .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */ 1074 838 { .fixed = 2 }, /* P, other */ ··· 1090 854 struct divs_data *data) 1091 855 { 1092 856 struct clk_onecell_data *clk_data; 1093 - const char *parent = node->name; 857 + const char *parent; 1094 858 const char *clk_name; 1095 859 struct clk **clks, *pclk; 1096 860 struct clk_hw *gate_hw, *rate_hw; ··· 1104 868 1105 869 /* Set up factor clock that we will be dividing */ 1106 870 pclk = sunxi_factors_clk_setup(node, data->factors); 871 + parent = __clk_get_name(pclk); 1107 872 1108 873 reg = of_iomap(node, 0); 1109 874 ··· 1207 970 1208 971 /* Matches for factors clocks */ 1209 972 static const struct of_device_id clk_factors_match[] __initconst = { 1210 - {.compatible = "allwinner,sun4i-pll1-clk", .data = &sun4i_pll1_data,}, 973 + {.compatible = "allwinner,sun4i-a10-pll1-clk", .data = &sun4i_pll1_data,}, 1211 974 {.compatible = "allwinner,sun6i-a31-pll1-clk", .data = &sun6i_a31_pll1_data,}, 1212 - {.compatible = "allwinner,sun4i-apb1-clk", .data = &sun4i_apb1_data,}, 1213 - {.compatible = "allwinner,sun4i-mod0-clk", .data = &sun4i_mod0_data,}, 975 + {.compatible = "allwinner,sun6i-a31-pll6-clk", .data = &sun6i_a31_pll6_data,}, 976 + {.compatible = "allwinner,sun4i-a10-apb1-clk", .data = &sun4i_apb1_data,}, 977 + {.compatible = "allwinner,sun4i-a10-mod0-clk", .data = &sun4i_mod0_data,}, 1214 978 {.compatible = "allwinner,sun7i-a20-out-clk", .data = &sun7i_a20_out_data,}, 1215 979 {} 1216 980 }; 1217 981 1218 982 /* Matches for divider clocks */ 1219 983 static const struct of_device_id clk_div_match[] __initconst = { 1220 - {.compatible = "allwinner,sun4i-axi-clk", .data = &sun4i_axi_data,}, 1221 - {.compatible = "allwinner,sun4i-ahb-clk", .data = &sun4i_ahb_data,}, 1222 - {.compatible = "allwinner,sun4i-apb0-clk", .data = &sun4i_apb0_data,}, 984 + {.compatible = "allwinner,sun4i-a10-axi-clk", .data = &sun4i_axi_data,}, 985 + {.compatible = "allwinner,sun4i-a10-ahb-clk", .data = &sun4i_ahb_data,}, 986 + {.compatible = "allwinner,sun4i-a10-apb0-clk", .data = &sun4i_apb0_data,}, 1223 987 {.compatible = "allwinner,sun6i-a31-apb2-div-clk", .data = &sun6i_a31_apb2_div_data,}, 1224 988 {} 1225 989 }; 1226 990 1227 991 /* Matches for divided outputs */ 1228 992 static const struct of_device_id clk_divs_match[] __initconst = { 1229 - {.compatible = "allwinner,sun4i-pll5-clk", .data = &pll5_divs_data,}, 1230 - {.compatible = "allwinner,sun4i-pll6-clk", .data = &pll6_divs_data,}, 993 + {.compatible = "allwinner,sun4i-a10-pll5-clk", .data = &pll5_divs_data,}, 994 + {.compatible = "allwinner,sun4i-a10-pll6-clk", .data = &pll6_divs_data,}, 1231 995 {} 1232 996 }; 1233 997 1234 998 /* Matches for mux clocks */ 1235 999 static const struct of_device_id clk_mux_match[] __initconst = { 1236 - {.compatible = "allwinner,sun4i-cpu-clk", .data = &sun4i_cpu_mux_data,}, 1237 - {.compatible = "allwinner,sun4i-apb1-mux-clk", .data = &sun4i_apb1_mux_data,}, 1000 + {.compatible = "allwinner,sun4i-a10-cpu-clk", .data = &sun4i_cpu_mux_data,}, 1001 + {.compatible = "allwinner,sun4i-a10-apb1-mux-clk", .data = &sun4i_apb1_mux_data,}, 1238 1002 {.compatible = "allwinner,sun6i-a31-ahb1-mux-clk", .data = &sun6i_a31_ahb1_mux_data,}, 1239 1003 {} 1240 1004 }; 1241 1005 1242 1006 /* Matches for gate clocks */ 1243 1007 static const struct of_device_id clk_gates_match[] __initconst = { 1244 - {.compatible = "allwinner,sun4i-axi-gates-clk", .data = &sun4i_axi_gates_data,}, 1245 - {.compatible = "allwinner,sun4i-ahb-gates-clk", .data = &sun4i_ahb_gates_data,}, 1008 + {.compatible = "allwinner,sun4i-a10-axi-gates-clk", .data = &sun4i_axi_gates_data,}, 1009 + {.compatible = "allwinner,sun4i-a10-ahb-gates-clk", .data = &sun4i_ahb_gates_data,}, 1246 1010 {.compatible = "allwinner,sun5i-a10s-ahb-gates-clk", .data = &sun5i_a10s_ahb_gates_data,}, 1247 1011 {.compatible = "allwinner,sun5i-a13-ahb-gates-clk", .data = &sun5i_a13_ahb_gates_data,}, 1248 1012 {.compatible = "allwinner,sun6i-a31-ahb1-gates-clk", .data = &sun6i_a31_ahb1_gates_data,}, 1249 1013 {.compatible = "allwinner,sun7i-a20-ahb-gates-clk", .data = &sun7i_a20_ahb_gates_data,}, 1250 - {.compatible = "allwinner,sun4i-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, 1014 + {.compatible = "allwinner,sun4i-a10-apb0-gates-clk", .data = &sun4i_apb0_gates_data,}, 1251 1015 {.compatible = "allwinner,sun5i-a10s-apb0-gates-clk", .data = &sun5i_a10s_apb0_gates_data,}, 1252 1016 {.compatible = "allwinner,sun5i-a13-apb0-gates-clk", .data = &sun5i_a13_apb0_gates_data,}, 1253 1017 {.compatible = "allwinner,sun7i-a20-apb0-gates-clk", .data = &sun7i_a20_apb0_gates_data,}, 1254 - {.compatible = "allwinner,sun4i-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, 1018 + {.compatible = "allwinner,sun4i-a10-apb1-gates-clk", .data = &sun4i_apb1_gates_data,}, 1255 1019 {.compatible = "allwinner,sun5i-a10s-apb1-gates-clk", .data = &sun5i_a10s_apb1_gates_data,}, 1256 1020 {.compatible = "allwinner,sun5i-a13-apb1-gates-clk", .data = &sun5i_a13_apb1_gates_data,}, 1257 1021 {.compatible = "allwinner,sun6i-a31-apb1-gates-clk", .data = &sun6i_a31_apb1_gates_data,}, 1258 1022 {.compatible = "allwinner,sun7i-a20-apb1-gates-clk", .data = &sun7i_a20_apb1_gates_data,}, 1259 1023 {.compatible = "allwinner,sun6i-a31-apb2-gates-clk", .data = &sun6i_a31_apb2_gates_data,}, 1024 + {.compatible = "allwinner,sun4i-a10-usb-clk", .data = &sun4i_a10_usb_gates_data,}, 1025 + {.compatible = "allwinner,sun5i-a13-usb-clk", .data = &sun5i_a13_usb_gates_data,}, 1260 1026 {} 1261 1027 }; 1262 1028