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

Merge tag 'omap-for-v4.5/81xx-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/fixes-non-critical

Merge "omap fixes for 81xx for v4.5 merge window" from Tony Lindgren:

Fixes for ti81xx for v4.5 merge window. We have hp t410 already booting
in mainline kernel with it's bootloader configured clocks. However,
trying to boot dm814x-evm uncovered all kind of issues with the timer
clock. To keep t410 booting, these issues need to be fixed in a specific
order and this branch contains both device tree and code changes.

To summarize the changes, we had missing ranges for clocks to probe,
missing aliase for clocks, wrong registers for divder clocks, and bad
address for the control module. All these went unnoticed earlier as
things worked without errors by luck and I did not pay much attention
to them until I got hold of a dm814x-evm and I noticed it did not boot.

As these are fixes for features that never worked, these can wait for
v4.5 merge window no problem.

* tag 'omap-for-v4.5/81xx-fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: Remove useless check for legacy booting for dm814x
ARM: OMAP2+: Enable GPIO for dm814x
ARM: dts: Fix dm814x pinctrl address and mask
ARM: dts: Fix dm8148 control modules ranges
ARM: OMAP2+: Fix timer entries for dm814x
ARM: dts: Fix some mux and divider clocks to get dm814x-evm booting
ARM: OMAP2+: Add DPPLS clock manager for dm814x
clk: ti: Add few dm814x clock aliases
ARM: dts: Fix dm814x entries for pllss and prcm

+124 -48
+81 -32
arch/arm/boot/dts/dm814x-clocks.dtsi
··· 4 4 * published by the Free Software Foundation. 5 5 */ 6 6 7 - &scm_clocks { 8 - 9 - tclkin_ck: tclkin_ck { 7 + &pllss_clocks { 8 + timer1_fck: timer1_fck { 10 9 #clock-cells = <0>; 11 - compatible = "fixed-clock"; 12 - clock-frequency = <32768>; 10 + compatible = "ti,mux-clock"; 11 + clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck 12 + &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>; 13 + ti,bit-shift = <3>; 14 + reg = <0x2e0>; 13 15 }; 14 16 17 + timer2_fck: timer2_fck { 18 + #clock-cells = <0>; 19 + compatible = "ti,mux-clock"; 20 + clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck 21 + &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>; 22 + ti,bit-shift = <6>; 23 + reg = <0x2e0>; 24 + }; 25 + 26 + sysclk18_ck: sysclk18_ck { 27 + #clock-cells = <0>; 28 + compatible = "ti,mux-clock"; 29 + clocks = <&rtcosc_ck>, <&rtcdivider_ck>; 30 + ti,bit-shift = <0>; 31 + reg = <0x02f0>; 32 + }; 33 + }; 34 + 35 + &scm_clocks { 15 36 devosc_ck: devosc_ck { 16 37 #clock-cells = <0>; 17 - compatible = "fixed-clock"; 18 - clock-frequency = <20000000>; 38 + compatible = "ti,mux-clock"; 39 + clocks = <&virt_20000000_ck>, <&virt_19200000_ck>; 40 + ti,bit-shift = <21>; 41 + reg = <0x0040>; 19 42 }; 20 43 21 44 /* Optional auxosc, 20 - 30 MHz range, assume 27 MHz by default */ ··· 46 23 #clock-cells = <0>; 47 24 compatible = "fixed-clock"; 48 25 clock-frequency = <27000000>; 26 + }; 27 + 28 + /* Optional 32768Hz crystal or clock on RTCOSC pins */ 29 + rtcosc_ck: rtcosc_ck { 30 + #clock-cells = <0>; 31 + compatible = "fixed-clock"; 32 + clock-frequency = <32768>; 33 + }; 34 + 35 + /* Optional external clock on TCLKIN pin, set rate in baord dts file */ 36 + tclkin_ck: tclkin_ck { 37 + #clock-cells = <0>; 38 + compatible = "fixed-clock"; 39 + clock-frequency = <0>; 40 + }; 41 + 42 + virt_20000000_ck: virt_20000000_ck { 43 + #clock-cells = <0>; 44 + compatible = "fixed-clock"; 45 + clock-frequency = <20000000>; 46 + }; 47 + 48 + virt_19200000_ck: virt_19200000_ck { 49 + #clock-cells = <0>; 50 + compatible = "fixed-clock"; 51 + clock-frequency = <19200000>; 49 52 }; 50 53 51 54 mpu_ck: mpu_ck { ··· 98 49 clock-frequency = <48000000>; 99 50 }; 100 51 101 - sysclk18_ck: sysclk18_ck { 102 - #clock-cells = <0>; 103 - compatible = "fixed-clock"; 104 - clock-frequency = <32768>; 105 - }; 106 - 107 52 cpsw_125mhz_gclk: cpsw_125mhz_gclk { 108 53 #clock-cells = <0>; 109 54 compatible = "fixed-clock"; ··· 112 69 113 70 }; 114 71 115 - &pllss_clocks { 72 + &prcm_clocks { 73 + osc_src_ck: osc_src_ck { 74 + #clock-cells = <0>; 75 + compatible = "fixed-factor-clock"; 76 + clocks = <&devosc_ck>; 77 + clock-mult = <1>; 78 + clock-div = <1>; 79 + }; 80 + 81 + mpu_clksrc_ck: mpu_clksrc_ck { 82 + #clock-cells = <0>; 83 + compatible = "ti,mux-clock"; 84 + clocks = <&devosc_ck>, <&rtcdivider_ck>; 85 + ti,bit-shift = <0>; 86 + reg = <0x0040>; 87 + }; 88 + 89 + /* Fixed divider clock 0.0016384 * devosc */ 90 + rtcdivider_ck: rtcdivider_ck { 91 + #clock-cells = <0>; 92 + compatible = "fixed-factor-clock"; 93 + clocks = <&devosc_ck>; 94 + clock-mult = <128>; 95 + clock-div = <78125>; 96 + }; 116 97 117 98 aud_clkin0_ck: aud_clkin0_ck { 118 99 #clock-cells = <0>; ··· 154 87 #clock-cells = <0>; 155 88 compatible = "fixed-clock"; 156 89 clock-frequency = <20000000>; 157 - }; 158 - 159 - timer1_mux_ck: timer1_mux_ck { 160 - #clock-cells = <0>; 161 - compatible = "ti,mux-clock"; 162 - clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck 163 - &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>; 164 - ti,bit-shift = <3>; 165 - reg = <0x2e0>; 166 - }; 167 - 168 - timer2_mux_ck: timer2_mux_ck { 169 - #clock-cells = <0>; 170 - compatible = "ti,mux-clock"; 171 - clocks = <&sysclk18_ck &aud_clkin0_ck &aud_clkin1_ck 172 - &aud_clkin2_ck &devosc_ck &auxosc_ck &tclkin_ck>; 173 - ti,bit-shift = <6>; 174 - reg = <0x2e0>; 175 90 }; 176 91 };
+25 -8
arch/arm/boot/dts/dm814x.dtsi
··· 58 58 ti,hwmods = "l3_main"; 59 59 60 60 /* 61 - * See TRM "Table 1-317. L4LS Instance Summary", just deduct 62 - * 0x1000 from the 1-317 addresses to get the device address 61 + * See TRM "Table 1-317. L4LS Instance Summary" for hints. 62 + * It shows the module target agent registers though, so the 63 + * actual device is typically 0x1000 before the target agent 64 + * except in cases where the module is larger than 0x1000. 63 65 */ 64 66 l4ls: l4ls@48000000 { 65 67 compatible = "ti,dm814-l4ls", "simple-bus"; ··· 185 183 186 184 control: control@140000 { 187 185 compatible = "ti,dm814-scm", "simple-bus"; 188 - reg = <0x140000 0x16d000>; 186 + reg = <0x140000 0x20000>; 189 187 #address-cells = <1>; 190 188 #size-cells = <1>; 191 - ranges = <0 0x160000 0x16d000>; 189 + ranges = <0 0x140000 0x20000>; 192 190 193 191 scm_conf: scm_conf@0 { 194 192 compatible = "syscon"; ··· 205 203 }; 206 204 }; 207 205 206 + /* 207 + * Note that silicon revision 2.1 and older 208 + * require input enabled (bit 18 set) for all 209 + * 3.3V I/Os to avoid cumulative hardware damage. 210 + * For more info, see errata advisory 2.1.87. 211 + * We leave bit 18 out of function-mask and rely 212 + * on the bootloader for it. 213 + */ 208 214 pincntl: pinmux@800 { 209 215 compatible = "pinctrl-single"; 210 - reg = <0x800 0xc38>; 216 + reg = <0x800 0x438>; 211 217 #address-cells = <1>; 212 218 #size-cells = <0>; 213 219 pinctrl-single,register-width = <32>; 214 - pinctrl-single,function-mask = <0x300ff>; 220 + pinctrl-single,function-mask = <0x307ff>; 215 221 }; 216 222 }; 217 223 218 224 prcm: prcm@180000 { 219 225 compatible = "ti,dm814-prcm", "simple-bus"; 220 - reg = <0x180000 0x4000>; 226 + reg = <0x180000 0x2000>; 227 + #address-cells = <1>; 228 + #size-cells = <1>; 229 + ranges = <0 0x180000 0x2000>; 221 230 222 231 prcm_clocks: clocks { 223 232 #address-cells = <1>; ··· 239 226 }; 240 227 }; 241 228 229 + /* See TRM PLL_SUBSYS_BASE and "PLLSS Registers" */ 242 230 pllss: pllss@1c5000 { 243 231 compatible = "ti,dm814-pllss", "simple-bus"; 244 - reg = <0x1c5000 0x2000>; 232 + reg = <0x1c5000 0x1000>; 233 + #address-cells = <1>; 234 + #size-cells = <1>; 235 + ranges = <0 0x1c5000 0x1000>; 245 236 246 237 pllss_clocks: clocks { 247 238 #address-cells = <1>;
+1 -2
arch/arm/mach-omap2/io.c
··· 612 612 ti814x_clockdomains_init(); 613 613 dm814x_hwmod_init(); 614 614 omap_hwmod_init_postsetup(); 615 - if (of_have_populated_dt()) 616 - omap_clk_soc_init = dm814x_dt_clk_init; 615 + omap_clk_soc_init = dm814x_dt_clk_init; 617 616 } 618 617 619 618 void __init ti816x_init_early(void)
+6 -6
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
··· 599 599 static struct omap_hwmod dm814x_timer1_hwmod = { 600 600 .name = "timer1", 601 601 .clkdm_name = "alwon_l3s_clkdm", 602 - .main_clk = "timer_sys_ck", 602 + .main_clk = "timer1_fck", 603 603 .dev_attr = &capability_alwon_dev_attr, 604 604 .class = &dm816x_timer_hwmod_class, 605 605 .flags = HWMOD_NO_IDLEST, ··· 608 608 static struct omap_hwmod_ocp_if dm814x_l4_ls__timer1 = { 609 609 .master = &dm81xx_l4_ls_hwmod, 610 610 .slave = &dm814x_timer1_hwmod, 611 - .clk = "timer_sys_ck", 611 + .clk = "timer1_fck", 612 612 .user = OCP_USER_MPU, 613 613 }; 614 614 ··· 636 636 static struct omap_hwmod dm814x_timer2_hwmod = { 637 637 .name = "timer2", 638 638 .clkdm_name = "alwon_l3s_clkdm", 639 - .main_clk = "timer_sys_ck", 639 + .main_clk = "timer2_fck", 640 640 .dev_attr = &capability_alwon_dev_attr, 641 641 .class = &dm816x_timer_hwmod_class, 642 642 .flags = HWMOD_NO_IDLEST, ··· 645 645 static struct omap_hwmod_ocp_if dm814x_l4_ls__timer2 = { 646 646 .master = &dm81xx_l4_ls_hwmod, 647 647 .slave = &dm814x_timer2_hwmod, 648 - .clk = "timer_sys_ck", 648 + .clk = "timer2_fck", 649 649 .user = OCP_USER_MPU, 650 650 }; 651 651 ··· 1230 1230 1231 1231 /* 1232 1232 * REVISIT: Test and enable the following once clocks work: 1233 - * dm81xx_l4_ls__gpio1 1234 - * dm81xx_l4_ls__gpio2 1235 1233 * dm81xx_l4_ls__mailbox 1236 1234 * dm81xx_alwon_l3_slow__gpmc 1237 1235 * dm81xx_default_l3_slow__usbss ··· 1248 1250 &dm81xx_l4_ls__wd_timer1, 1249 1251 &dm81xx_l4_ls__i2c1, 1250 1252 &dm81xx_l4_ls__i2c2, 1253 + &dm81xx_l4_ls__gpio1, 1254 + &dm81xx_l4_ls__gpio2, 1251 1255 &dm81xx_l4_ls__elm, 1252 1256 &dm81xx_l4_ls__mcspi1, 1253 1257 &dm81xx_alwon_l3_fast__tpcc,
+6
arch/arm/mach-omap2/prm_common.c
··· 662 662 .index = TI_CLKM_PRM, 663 663 .init = am33xx_prm_init, 664 664 }; 665 + 666 + static struct omap_prcm_init_data dm814_pllss_data __initdata = { 667 + .index = TI_CLKM_PLLSS, 668 + .init = am33xx_prm_init, 669 + }; 665 670 #endif 666 671 667 672 #ifdef CONFIG_ARCH_OMAP4 ··· 720 715 #endif 721 716 #ifdef CONFIG_SOC_TI81XX 722 717 { .compatible = "ti,dm814-prcm", .data = &am3_prm_data }, 718 + { .compatible = "ti,dm814-pllss", .data = &dm814_pllss_data }, 723 719 { .compatible = "ti,dm816-prcm", .data = &am3_prm_data }, 724 720 #endif 725 721 #ifdef CONFIG_ARCH_OMAP2
+4
drivers/clk/ti/clk-814x.c
··· 14 14 DT_CLK(NULL, "devosc_ck", "devosc_ck"), 15 15 DT_CLK(NULL, "mpu_ck", "mpu_ck"), 16 16 DT_CLK(NULL, "sysclk4_ck", "sysclk4_ck"), 17 + DT_CLK(NULL, "sysclk5_ck", "sysclk5_ck"), 17 18 DT_CLK(NULL, "sysclk6_ck", "sysclk6_ck"), 19 + DT_CLK(NULL, "sysclk8_ck", "sysclk8_ck"), 18 20 DT_CLK(NULL, "sysclk10_ck", "sysclk10_ck"), 19 21 DT_CLK(NULL, "sysclk18_ck", "sysclk18_ck"), 20 22 DT_CLK(NULL, "timer_sys_ck", "devosc_ck"), 23 + DT_CLK(NULL, "timer1_fck", "timer1_fck"), 24 + DT_CLK(NULL, "timer2_fck", "timer2_fck"), 21 25 DT_CLK(NULL, "cpsw_125mhz_gclk", "cpsw_125mhz_gclk"), 22 26 DT_CLK(NULL, "cpsw_cpts_rft_clk", "cpsw_cpts_rft_clk"), 23 27 { .node_name = NULL },
+1
include/linux/clk/ti.h
··· 195 195 TI_CLKM_PRM, 196 196 TI_CLKM_SCRM, 197 197 TI_CLKM_CTRL, 198 + TI_CLKM_PLLSS, 198 199 CLK_MAX_MEMMAPS 199 200 }; 200 201