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

ARM: dts: Modernize the Vexpress PL111 integration

The Versatile Express was submitted with the actual display
bridges unconnected (but defined in the device tree) and
mock "panels" encoded in the device tree node of the PL111
controller.

This doesn't even remotely describe the actual Versatile
Express hardware. Exploit the SiI9022 bridge by connecting
the PL111 pads to it, making it use EDID or fallback values
to drive the monitor.

The also has to use the reserved memory through the
CMA pool rather than by open coding a memory region and
remapping it explicitly in the driver. To achieve this,
a reserved-memory node must exist in the root of the
device tree, so we need to pull that out of the
motherboard .dtsi include files, and push it into each
top-level device tree instead.

We do the same manouver for all the Versatile Express
boards, taking into account the different location of the
video RAM depending on which chip select is used on
each platform.

This plays nicely with the new PL111 DRM driver and
follows the standard ways of assigning bridges and
memory pools for graphics.

Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Mali DP Maintainers <malidp@foss.arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Tested-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+150 -121
+17 -32
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
··· 43 43 bank-width = <4>; 44 44 }; 45 45 46 - v2m_video_ram: vram@2,00000000 { 47 - compatible = "arm,vexpress-vram"; 48 - reg = <2 0x00000000 0x00800000>; 49 - }; 50 - 51 46 ethernet@2,02000000 { 52 47 compatible = "smsc,lan9118", "smsc,lan9115"; 53 48 reg = <2 0x02000000 0x10000>; ··· 218 223 v2m_i2c_dvi: i2c@160000 { 219 224 compatible = "arm,versatile-i2c"; 220 225 reg = <0x160000 0x1000>; 221 - 222 226 #address-cells = <1>; 223 227 #size-cells = <0>; 224 228 225 229 dvi-transmitter@39 { 226 230 compatible = "sil,sii9022-tpi", "sil,sii9022"; 227 231 reg = <0x39>; 232 + 233 + ports { 234 + #address-cells = <1>; 235 + #size-cells = <0>; 236 + 237 + port@0 { 238 + reg = <0>; 239 + dvi_bridge_in: endpoint { 240 + remote-endpoint = <&clcd_pads>; 241 + }; 242 + }; 243 + }; 228 244 }; 229 245 230 246 dvi-transmitter@60 { ··· 266 260 interrupts = <14>; 267 261 clocks = <&v2m_oscclk1>, <&smbclk>; 268 262 clock-names = "clcdclk", "apb_pclk"; 269 - memory-region = <&v2m_video_ram>; 270 - max-memory-bandwidth = <50350000>; /* 16bpp @ 25.175MHz */ 263 + /* 800x600 16bpp @36MHz works fine */ 264 + max-memory-bandwidth = <54000000>; 265 + memory-region = <&vram>; 271 266 272 267 port { 273 - v2m_clcd_pads: endpoint { 274 - remote-endpoint = <&v2m_clcd_panel>; 268 + clcd_pads: endpoint { 269 + remote-endpoint = <&dvi_bridge_in>; 275 270 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 276 - }; 277 - }; 278 - 279 - panel { 280 - compatible = "panel-dpi"; 281 - 282 - port { 283 - v2m_clcd_panel: endpoint { 284 - remote-endpoint = <&v2m_clcd_pads>; 285 - }; 286 - }; 287 - 288 - panel-timing { 289 - clock-frequency = <25175000>; 290 - hactive = <640>; 291 - hback-porch = <40>; 292 - hfront-porch = <24>; 293 - hsync-len = <96>; 294 - vactive = <480>; 295 - vback-porch = <32>; 296 - vfront-porch = <11>; 297 - vsync-len = <2>; 298 271 }; 299 272 }; 300 273 };
+31 -32
arch/arm/boot/dts/vexpress-v2m.dtsi
··· 43 43 bank-width = <4>; 44 44 }; 45 45 46 - v2m_video_ram: vram@3,00000000 { 47 - compatible = "arm,vexpress-vram"; 48 - reg = <3 0x00000000 0x00800000>; 49 - }; 50 - 51 46 ethernet@3,02000000 { 52 47 compatible = "smsc,lan9118", "smsc,lan9115"; 53 48 reg = <3 0x02000000 0x10000>; ··· 218 223 v2m_i2c_dvi: i2c@16000 { 219 224 compatible = "arm,versatile-i2c"; 220 225 reg = <0x16000 0x1000>; 221 - 222 226 #address-cells = <1>; 223 227 #size-cells = <0>; 224 228 225 229 dvi-transmitter@39 { 226 230 compatible = "sil,sii9022-tpi", "sil,sii9022"; 227 231 reg = <0x39>; 232 + 233 + ports { 234 + #address-cells = <1>; 235 + #size-cells = <0>; 236 + 237 + /* 238 + * Both the core tile and the motherboard routes their output 239 + * pads to this transmitter. The motherboard system controller 240 + * can select one of them as input using a mux register in 241 + * "arm,vexpress-muxfpga". The Vexpress with the CA9 core tile is 242 + * the only platform with this specific set-up. 243 + */ 244 + port@0 { 245 + reg = <0>; 246 + dvi_bridge_in_ct: endpoint { 247 + remote-endpoint = <&clcd_pads_ct>; 248 + }; 249 + }; 250 + port@1 { 251 + reg = <1>; 252 + dvi_bridge_in_mb: endpoint { 253 + remote-endpoint = <&clcd_pads_mb>; 254 + }; 255 + }; 256 + }; 228 257 }; 229 258 230 259 dvi-transmitter@60 { ··· 272 253 reg-shift = <2>; 273 254 }; 274 255 256 + 275 257 clcd@1f000 { 276 258 compatible = "arm,pl111", "arm,primecell"; 277 259 reg = <0x1f000 0x1000>; ··· 280 260 interrupts = <14>; 281 261 clocks = <&v2m_oscclk1>, <&smbclk>; 282 262 clock-names = "clcdclk", "apb_pclk"; 283 - memory-region = <&v2m_video_ram>; 284 - max-memory-bandwidth = <50350000>; /* 16bpp @ 25.175MHz */ 263 + /* 800x600 16bpp @36MHz works fine */ 264 + max-memory-bandwidth = <54000000>; 265 + memory-region = <&vram>; 285 266 286 267 port { 287 - v2m_clcd_pads: endpoint { 288 - remote-endpoint = <&v2m_clcd_panel>; 268 + clcd_pads_mb: endpoint { 269 + remote-endpoint = <&dvi_bridge_in_mb>; 289 270 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 290 - }; 291 - }; 292 - 293 - panel { 294 - compatible = "panel-dpi"; 295 - 296 - port { 297 - v2m_clcd_panel: endpoint { 298 - remote-endpoint = <&v2m_clcd_pads>; 299 - }; 300 - }; 301 - 302 - panel-timing { 303 - clock-frequency = <25175000>; 304 - hactive = <640>; 305 - hback-porch = <40>; 306 - hfront-porch = <24>; 307 - hsync-len = <96>; 308 - vactive = <480>; 309 - vback-porch = <32>; 310 - vfront-porch = <11>; 311 - vsync-len = <2>; 312 271 }; 313 272 }; 314 273 };
+14
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
··· 53 53 reg = <0 0x80000000 0 0x40000000>; 54 54 }; 55 55 56 + reserved-memory { 57 + #address-cells = <2>; 58 + #size-cells = <2>; 59 + ranges; 60 + 61 + /* Chipselect 2 is physically at 0x18000000 */ 62 + vram: vram@18000000 { 63 + /* 8 MB of designated video RAM */ 64 + compatible = "shared-dma-pool"; 65 + reg = <0 0x18000000 0 0x00800000>; 66 + no-map; 67 + }; 68 + }; 69 + 56 70 hdlcd@2b000000 { 57 71 compatible = "arm,hdlcd"; 58 72 reg = <0 0x2b000000 0 0x1000>;
+14
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
··· 104 104 reg = <0 0x80000000 0 0x40000000>; 105 105 }; 106 106 107 + reserved-memory { 108 + #address-cells = <2>; 109 + #size-cells = <2>; 110 + ranges; 111 + 112 + /* Chipselect 2 is physically at 0x18000000 */ 113 + vram: vram@18000000 { 114 + /* 8 MB of designated video RAM */ 115 + compatible = "shared-dma-pool"; 116 + reg = <0 0x18000000 0 0x00800000>; 117 + no-map; 118 + }; 119 + }; 120 + 107 121 wdt@2a490000 { 108 122 compatible = "arm,sp805", "arm,primecell"; 109 123 reg = <0 0x2a490000 0 0x1000>;
+14
arch/arm/boot/dts/vexpress-v2p-ca5s.dts
··· 55 55 reg = <0x80000000 0x40000000>; 56 56 }; 57 57 58 + reserved-memory { 59 + #address-cells = <1>; 60 + #size-cells = <1>; 61 + ranges; 62 + 63 + /* Chipselect 2 is physically at 0x18000000 */ 64 + vram: vram@18000000 { 65 + /* 8 MB of designated video RAM */ 66 + compatible = "shared-dma-pool"; 67 + reg = <0x18000000 0x00800000>; 68 + no-map; 69 + }; 70 + }; 71 + 58 72 hdlcd@2a110000 { 59 73 compatible = "arm,hdlcd"; 60 74 reg = <0x2a110000 0x1000>;
+18 -25
arch/arm/boot/dts/vexpress-v2p-ca9.dts
··· 69 69 reg = <0x60000000 0x40000000>; 70 70 }; 71 71 72 + reserved-memory { 73 + #address-cells = <1>; 74 + #size-cells = <1>; 75 + ranges; 76 + 77 + /* Chipselect 3 is physically at 0x4c000000 */ 78 + vram: vram@4c000000 { 79 + /* 8 MB of designated video RAM */ 80 + compatible = "shared-dma-pool"; 81 + reg = <0x4c000000 0x00800000>; 82 + no-map; 83 + }; 84 + }; 85 + 72 86 clcd@10020000 { 73 87 compatible = "arm,pl111", "arm,primecell"; 74 88 reg = <0x10020000 0x1000>; ··· 90 76 interrupts = <0 44 4>; 91 77 clocks = <&oscclk1>, <&oscclk2>; 92 78 clock-names = "clcdclk", "apb_pclk"; 93 - max-memory-bandwidth = <130000000>; /* 16bpp @ 63.5MHz */ 79 + /* 1024x768 16bpp @65MHz */ 80 + max-memory-bandwidth = <95000000>; 94 81 95 82 port { 96 - clcd_pads: endpoint { 97 - remote-endpoint = <&clcd_panel>; 83 + clcd_pads_ct: endpoint { 84 + remote-endpoint = <&dvi_bridge_in_ct>; 98 85 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 99 - }; 100 - }; 101 - 102 - panel { 103 - compatible = "panel-dpi"; 104 - 105 - port { 106 - clcd_panel: endpoint { 107 - remote-endpoint = <&clcd_pads>; 108 - }; 109 - }; 110 - 111 - panel-timing { 112 - clock-frequency = <63500127>; 113 - hactive = <1024>; 114 - hback-porch = <152>; 115 - hfront-porch = <48>; 116 - hsync-len = <104>; 117 - vactive = <768>; 118 - vback-porch = <23>; 119 - vfront-porch = <3>; 120 - vsync-len = <4>; 121 86 }; 122 87 }; 123 88 };
+23
arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts
··· 78 78 <0x00000008 0x80000000 0 0x80000000>; 79 79 }; 80 80 81 + reserved-memory { 82 + #address-cells = <2>; 83 + #size-cells = <2>; 84 + ranges; 85 + 86 + /* Chipselect 2,00000000 is physically at 0x18000000 */ 87 + vram: vram@18000000 { 88 + /* 8 MB of designated video RAM */ 89 + compatible = "shared-dma-pool"; 90 + reg = <0x00000000 0x18000000 0 0x00800000>; 91 + no-map; 92 + }; 93 + }; 94 + 81 95 gic: interrupt-controller@2c001000 { 82 96 compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; 83 97 #interrupt-cells = <3>; ··· 119 105 <0 61 4>, 120 106 <0 62 4>, 121 107 <0 63 4>; 108 + }; 109 + 110 + panel { 111 + compatible = "arm,rtsm-display"; 112 + port { 113 + panel_in: endpoint { 114 + remote-endpoint = <&clcd_pads>; 115 + }; 116 + }; 122 117 }; 123 118 124 119 smb@8000000 {
+5 -32
arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi
··· 24 24 bank-width = <4>; 25 25 }; 26 26 27 - v2m_video_ram: vram@2,00000000 { 28 - compatible = "arm,vexpress-vram"; 29 - reg = <2 0x00000000 0x00800000>; 30 - }; 31 - 32 27 ethernet@2,02000000 { 33 28 compatible = "smsc,lan91c111"; 34 29 reg = <2 0x02000000 0x10000>; ··· 182 187 interrupts = <14>; 183 188 clocks = <&v2m_oscclk1>, <&v2m_clk24mhz>; 184 189 clock-names = "clcdclk", "apb_pclk"; 185 - arm,pl11x,framebuffer = <0x18000000 0x00180000>; 186 - memory-region = <&v2m_video_ram>; 187 - max-memory-bandwidth = <130000000>; /* 16bpp @ 63.5MHz */ 190 + /* 800x600 16bpp @36MHz works fine */ 191 + max-memory-bandwidth = <54000000>; 192 + memory-region = <&vram>; 188 193 189 194 port { 190 - v2m_clcd_pads: endpoint { 191 - remote-endpoint = <&v2m_clcd_panel>; 195 + clcd_pads: endpoint { 196 + remote-endpoint = <&panel_in>; 192 197 arm,pl11x,tft-r0g0b0-pads = <0 8 16>; 193 - }; 194 - }; 195 - 196 - panel { 197 - compatible = "panel-dpi"; 198 - 199 - port { 200 - v2m_clcd_panel: endpoint { 201 - remote-endpoint = <&v2m_clcd_pads>; 202 - }; 203 - }; 204 - 205 - panel-timing { 206 - clock-frequency = <63500127>; 207 - hactive = <1024>; 208 - hback-porch = <152>; 209 - hfront-porch = <48>; 210 - hsync-len = <104>; 211 - vactive = <768>; 212 - vback-porch = <23>; 213 - vfront-porch = <3>; 214 - vsync-len = <4>; 215 198 }; 216 199 }; 217 200 };
+14
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
··· 65 65 reg = <0 0x80000000 0 0x80000000>; /* 2GB @ 2GB */ 66 66 }; 67 67 68 + reserved-memory { 69 + #address-cells = <2>; 70 + #size-cells = <2>; 71 + ranges; 72 + 73 + /* Chipselect 2 is physically at 0x18000000 */ 74 + vram: vram@18000000 { 75 + /* 8 MB of designated video RAM */ 76 + compatible = "shared-dma-pool"; 77 + reg = <0 0x18000000 0 0x00800000>; 78 + no-map; 79 + }; 80 + }; 81 + 68 82 gic: interrupt-controller@2c001000 { 69 83 compatible = "arm,gic-400"; 70 84 #interrupt-cells = <3>;