diff --git a/Documentation/devicetree/bindings/display/xlnx/xlnx,mixer.txt b/Documentation/devicetree/bindings/display/xlnx/xlnx,mixer.txt index a9b1907354fc9f..0ed4705c7b4e0f 100644 --- a/Documentation/devicetree/bindings/display/xlnx/xlnx,mixer.txt +++ b/Documentation/devicetree/bindings/display/xlnx/xlnx,mixer.txt @@ -16,6 +16,7 @@ Required properties: - xlnx,dma-addr-width: dma address width, valid values are 32 and 64 - xlnx,bpc: bits per component for mixer - xlnx,ppc: pixel per clock for mixer + - xlnx,num-layers: Total number of layers (excluding logo) - layer_[x]: node for [x] layer - xlnx,layer-id: layer identifier number - xlnx,vformat: video format for layer. See list of supported formats below. @@ -24,6 +25,8 @@ Required properties: not required for overlay layers - xlnx,layer-max-height: max layer height, mandatory for master layer Not required for overlay layers + - xlnx,layer-primary: denotes the primary layer, should be mentioned in node + of layer which is expected to be constructing the primary plane Optional properties: - dmas: dma attach to layer, mandatory for master layer @@ -37,6 +40,8 @@ Optional properties: - xlnx,layer-scale: denotes layer can be scale to 2x and 4x - xlnx,logo-layer: denotes logo layer is enable - logo: logo layer + - xlnx,bridge: phandle to bridge node. + This handle is required only when VTC is connected as bridge. Supported Formats: Mixer IP Format Driver supported Format String @@ -76,6 +81,7 @@ Example: xlnx,ppc = <2>; xlnx,num-layers = <8>; xlnx,logo-layer; + xlnx,bridge = <&v_tc_0>; mixer_port: mixer_port@0 { reg = <0>; @@ -91,6 +97,7 @@ Example: dmas = <&axi_vdma_0 0>; dma-names = "dma0"; xlnx,layer-streaming; + xlnx,layer-primary; }; xv_mix_overlay_1: layer_1 { xlnx,layer-id = <1>; diff --git a/Documentation/devicetree/bindings/display/xlnx/xlnx,pl-disp.txt b/Documentation/devicetree/bindings/display/xlnx/xlnx,pl-disp.txt index 232a8a58397634..c6034bffc64abf 100644 --- a/Documentation/devicetree/bindings/display/xlnx/xlnx,pl-disp.txt +++ b/Documentation/devicetree/bindings/display/xlnx/xlnx,pl-disp.txt @@ -20,6 +20,10 @@ Required properties: Documentation/devicetree/bindings/graph.txt. - reg: Base address and size of device +Optional properties: + - xlnx,bridge: bridge phandle + This handle is required only when VTC is connected as bridge. + Example: drm-pl-disp-drv { @@ -27,6 +31,7 @@ Example: dmas = <&axi_vdma_0 0>; dma-names = "dma0"; xlnx,vformat = "YUYV"; + xlnx,bridge = <&v_tc_0>; pl_disp_port@0 { reg = <0>; endpoint { diff --git a/Documentation/devicetree/bindings/display/xlnx/xlnx,vtc.txt b/Documentation/devicetree/bindings/display/xlnx/xlnx,vtc.txt new file mode 100644 index 00000000000000..bafacea86b28cf --- /dev/null +++ b/Documentation/devicetree/bindings/display/xlnx/xlnx,vtc.txt @@ -0,0 +1,27 @@ +Device-Tree bindings for Xilinx Video Timing Controller(VTC) + +Xilinx VTC is a general purpose video timing generator and detector. +The input side of this core automatically detects horizontal and +vertical synchronization, pulses, polarity, blanking timing and active pixels. +While on the output, it generates the horizontal and vertical blanking and +synchronization pulses used with a standard video system including support +for programmable pulse polarity. + +The core is commonly used with Video in to AXI4-Stream core to detect the +format and timing of incoming video data or with AXI4-Stream to Video out core +to generate outgoing video timing for downstream sinks like a video monitor. + +For details please refer to +https://www.xilinx.com/support/documentation/ip_documentation/v_tc/v6_1/pg016_v_tc.pdf + +Required properties: + - compatible: value should be "xlnx,bridge-v-tc-6.1" + - reg: base address and size of the VTC IP + - xlnx,pixels-per-clock: Pixels per clock of the stream. Can be 1, 2 or 4. + +Example: + v_tc_0: v_tc@80030000 { + compatible = "xlnx,bridge-v-tc-6.1"; + reg = <0x0 0x80030000 0x0 0x10000>; + xlnx,pixels-per-clock = <2>; + }; diff --git a/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt index a564e123949808..411633a9f08162 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt @@ -31,6 +31,7 @@ Optional properties: - xlnx,dout-default-2 : as above but the second channel - xlnx,gpio2-width : as above but for the second channel - xlnx,tri-default-2 : as above but for the second channel +- xlnx,no-init : No initialisation at probe Example: diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi index a02ad793036f67..af0b9dc0e0092e 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi @@ -267,6 +267,10 @@ clocks = <&clk 75>; }; +&lpd_watchdog { + clocks = <&clk 75>; +}; + &xilinx_ams { clocks = <&clk 70>; }; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi index e62ccf74f61b5d..486f7cbe7c7ca0 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi @@ -225,6 +225,10 @@ clocks = <&clk250>; }; +&lpd_watchdog { + clocks = <&clk250>; +}; + &zynqmp_dpsub { clocks = <&dp_aclk>, <&dp_aud_clk>, <&drm_clock>; }; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts index 18ff9291f5110e..ba1df140c10028 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dts @@ -486,7 +486,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0_default>; - spi0_flash0: flash0@0 { + spi0_flash0: flash@0 { #address-cells = <1>; #size-cells = <1>; compatible = "sst,sst25wf080", "jedec,spi-nor"; @@ -506,7 +506,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1_default>; - spi1_flash0: flash0@0 { + spi1_flash0: flash@0 { #address-cells = <1>; #size-cells = <1>; compatible = "atmel,at45db041e", "atmel,at45", "atmel,dataflash"; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts index c130f77c351e50..e1f673c0d278ba 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts @@ -107,6 +107,7 @@ ltc2954: ltc2954 { /* U7 */ compatible = "lltc,ltc2954", "lltc,ltc2952"; + status = "disabled"; trigger-gpios = <&gpio 26 GPIO_ACTIVE_LOW>; /* INT line - input */ /* If there is HW watchdog on mezzanine this signal should be connected there */ watchdog-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>; /* MIO on PAD */ @@ -473,7 +474,6 @@ &sdhci0 { status = "okay"; no-1-8-v; - broken-cd; /* CD has to be enabled by default */ disable-wp; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_sdhci0_default>; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts index fb0c7bf0fd8089..bdcda3f1640948 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts @@ -442,6 +442,7 @@ temperature-stability = <50>; factory-fout = <300000000>; clock-frequency = <300000000>; + clock-output-names = "si570_user"; }; }; i2c@3 { @@ -455,6 +456,7 @@ temperature-stability = <50>; /* copy from zc702 */ factory-fout = <156250000>; clock-frequency = <148500000>; + clock-output-names = "si570_mgt"; }; }; i2c@4 { diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts index 58025ec64d8601..0f43148ff86a5c 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dts @@ -141,9 +141,9 @@ #address-cells = <1>; #size-cells = <0>; reg = <4>; - tca6416_u97: gpio@21 { + tca6416_u97: gpio@20 { compatible = "ti,tca6416"; - reg = <0x21>; + reg = <0x20>; gpio-controller; #gpio-cells = <2>; /* diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dts index c8e74734b34927..df2fe1674d6906 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dts @@ -85,9 +85,9 @@ scl-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; - tca6416_u97: gpio@21 { + tca6416_u97: gpio@20 { compatible = "ti,tca6416"; - reg = <0x21>; + reg = <0x20>; gpio-controller; #gpio-cells = <2>; /* @@ -156,10 +156,15 @@ }; }; - i2c@4 { + i2c@3 { #address-cells = <1>; #size-cells = <0>; - reg = <4>; + reg = <3>; + ina226@40 { /* u183 */ + compatible = "ti,ina226"; + reg = <0x40>; + shunt-resistor = <5000>; + }; }; i2c@5 { @@ -174,7 +179,7 @@ reg = <7>; }; - /* 3, 6 not connected */ + /* 4, 6 not connected */ }; }; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts index 30ffd4f50fc30d..96cbec8aeb6fb0 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts @@ -415,6 +415,7 @@ temperature-stability = <50>; factory-fout = <300000000>; clock-frequency = <300000000>; + clock-output-names = "si570_user"; }; }; i2c@3 { @@ -428,6 +429,7 @@ temperature-stability = <50>; /* copy from zc702 */ factory-fout = <156250000>; clock-frequency = <148500000>; + clock-output-names = "si570_mgt"; }; }; i2c@4 { diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts b/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts index d94a4d161a7871..a46a54f0865123 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts +++ b/arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts @@ -336,6 +336,7 @@ temperature-stability = <50>; factory-fout = <300000000>; clock-frequency = <300000000>; + clock-output-names = "si570_user"; }; }; i2c@3 { @@ -349,6 +350,7 @@ temperature-stability = <50>; factory-fout = <156250000>; clock-frequency = <148500000>; + clock-output-names = "si570_mgt"; }; }; i2c@4 { diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index fb196a153d9eb4..efc49c88b50ba7 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -878,8 +878,8 @@ interrupts = <0 133 4>; power-domains = <&pd_sata>; #stream-id-cells = <4>; - iommus = <&smmu 0x4c0>, <&smmu 0x4c1>, - <&smmu 0x4c2>, <&smmu 0x4c3>; + /* iommus = <&smmu 0x4c0>, <&smmu 0x4c1>, */ + /* <&smmu 0x4c2>, <&smmu 0x4c3>; */ /* dma-coherent; */ }; @@ -919,7 +919,7 @@ compatible = "arm,mmu-500"; reg = <0x0 0xfd800000 0x0 0x20000>; #iommu-cells = <1>; - status = "disabled"; + status = "okay"; #global-interrupts = <1>; interrupt-parent = <&gic>; interrupts = <0 155 4>, @@ -1083,6 +1083,15 @@ timeout-sec = <10>; }; + lpd_watchdog: watchdog@ff150000 { + compatible = "cdns,wdt-r1p2"; + status = "disabled"; + interrupt-parent = <&gic>; + interrupts = <0 52 1>; + reg = <0x0 0xff150000 0x0 0x1000>; + timeout-sec = <10>; + }; + xilinx_ams: ams@ffa50000 { compatible = "xlnx,zynqmp-ams"; status = "disabled"; diff --git a/arch/arm64/configs/xilinx_zynqmp_defconfig b/arch/arm64/configs/xilinx_zynqmp_defconfig index 80ac9f74582921..fe2f52d7c8af24 100644 --- a/arch/arm64/configs/xilinx_zynqmp_defconfig +++ b/arch/arm64/configs/xilinx_zynqmp_defconfig @@ -140,9 +140,12 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ARASAN=y CONFIG_MTD_SPI_NOR=y +CONFIG_OF_OVERLAY=y +CONFIG_OF_CONFIGFS=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=65536 +CONFIG_XILINX_SDFEC=y CONFIG_XILINX_JESD204B=y CONFIG_XILINX_JESD204B_PHY=y CONFIG_EEPROM_AT24=y @@ -177,6 +180,7 @@ CONFIG_REALTEK_PHY=y CONFIG_SMSC_PHY=y CONFIG_STE10XP=y CONFIG_VITESSE_PHY=y +CONFIG_XILINX_GMII2RGMII=y CONFIG_USB_USBNET=y CONFIG_WL18XX=y CONFIG_WLCORE_SPI=y diff --git a/drivers/clk/idt/clk-idt8t49n24x-core.c b/drivers/clk/idt/clk-idt8t49n24x-core.c index fb8f4db76f99b0..ad23014e708f80 100644 --- a/drivers/clk/idt/clk-idt8t49n24x-core.c +++ b/drivers/clk/idt/clk-idt8t49n24x-core.c @@ -46,8 +46,10 @@ #define IDT24x_VCO_MAX 4000004000u #define IDT24x_VCO_OPT 3500000000u #define IDT24x_MIN_INT_DIVIDER 6 +#define IDT24x_MIN_NS1 4 +#define IDT24x_MAX_NS1 6 -u8 q0_ns1_options[3] = { 4, 5, 6 }; +static u8 q0_ns1_options[3] = { 5, 6, 4 }; /** * bits_to_shift - num bits to shift given specified mask @@ -295,11 +297,8 @@ static int idt24x_calc_div_q0(struct clk_idt24x_chip *chip) "%s. requested: %u, min_div: %u, max_div: %u", __func__, chip->clk[0].requested, min_div, max_div); - min_ns2 = div64_u64( - (u64)min_div, - q0_ns1_options[ARRAY_SIZE(q0_ns1_options) - 1] * 2); - max_ns2 = div64_u64( - (u64)max_div, q0_ns1_options[0] * 2); + min_ns2 = div64_u64((u64)min_div, IDT24x_MAX_NS1 * 2); + max_ns2 = div64_u64((u64)max_div, IDT24x_MIN_NS1 * 2); dev_dbg(&chip->i2c_client->dev, "%s. min_ns2: %u, max_ns2: %u", __func__, min_ns2, max_ns2); @@ -343,7 +342,7 @@ static int idt24x_calc_div_q0(struct clk_idt24x_chip *chip) current_vco > best_vco) use = true; if (use) { - chip->divs.ns1_q0 = q0_ns1_options[x]; + chip->divs.ns1_q0 = x; chip->divs.ns2_q0 = y; best_vco = current_vco; } @@ -353,10 +352,9 @@ static int idt24x_calc_div_q0(struct clk_idt24x_chip *chip) } dev_dbg(&chip->i2c_client->dev, - "%s. best: (ns1=%u * ns2=%u * 2 * %u) == %u", - __func__, chip->divs.ns1_q0, chip->divs.ns2_q0, - chip->clk[0].requested, - best_vco); + "%s. best: (ns1=%u [/%u] * ns2=%u * 2 * %u) == %u", + __func__, chip->divs.ns1_q0, q0_ns1_options[chip->divs.ns1_q0], + chip->divs.ns2_q0, chip->clk[0].requested, best_vco); return 0; } @@ -380,16 +378,17 @@ static int idt24x_calc_divs(struct clk_idt24x_chip *chip) return result; dev_dbg(&chip->i2c_client->dev, - "%s: after idt24x_calc_div_q0. ns1: %u, ns2: %u", - __func__, chip->divs.ns1_q0, chip->divs.ns2_q0); + "%s: after idt24x_calc_div_q0. ns1: %u [/%u], ns2: %u", + __func__, chip->divs.ns1_q0, q0_ns1_options[chip->divs.ns1_q0], + chip->divs.ns2_q0); chip->divs.dsmint = 0; chip->divs.dsmfrac = 0; - if (chip->divs.ns1_q0 > 0) { + if (chip->clk[0].requested > 0) { /* Q0 is in use and is governing the actual VCO freq */ - vco = chip->divs.ns1_q0 * chip->divs.ns2_q0 * 2 * - chip->clk[0].requested; + vco = q0_ns1_options[chip->divs.ns1_q0] * chip->divs.ns2_q0 * + 2 * chip->clk[0].requested; } else { u32 freq = 0; u32 walk; @@ -690,10 +689,10 @@ static int idt24x_update_device(struct clk_idt24x_chip *chip) dev_dbg(&client->dev, "%s: setting IDT24x_REG_NS1_Q0 (val %u @ 0x%x)", - __func__, chip->divs.ns1_q0 >> 8, IDT24x_REG_NS1_Q0); + __func__, chip->divs.ns1_q0, IDT24x_REG_NS1_Q0); err = i2cwritewithmask( client, chip->regmap, IDT24x_REG_NS1_Q0, - (chip->divs.ns1_q0 >> 8) & IDT24x_REG_NS1_Q0_MASK, + chip->divs.ns1_q0 & IDT24x_REG_NS1_Q0_MASK, chip->reg_ns1_q0, IDT24x_REG_NS1_Q0_MASK); if (err) { dev_err(&client->dev, diff --git a/drivers/clk/idt/clk-idt8t49n24x-debugfs.c b/drivers/clk/idt/clk-idt8t49n24x-debugfs.c index d8fcf4e799744a..967a9df8701c71 100644 --- a/drivers/clk/idt/clk-idt8t49n24x-debugfs.c +++ b/drivers/clk/idt/clk-idt8t49n24x-debugfs.c @@ -16,7 +16,7 @@ #include "clk-idt8t49n24x-debugfs.h" -struct clk_idt24x_chip *idt24x_chip_fordebugfs; +static struct clk_idt24x_chip *idt24x_chip_fordebugfs; static int idt24x_read_all_settings( struct clk_idt24x_chip *chip, char *output_buffer, int count) @@ -234,6 +234,7 @@ static ssize_t idt24x_debugfs_writer_i2c(struct file *fp, int err = 0; int x = 0; int start = 0; + ssize_t written; unsigned int reg = -1; u8 val[WRITE_BLOCK_SIZE]; u16 nextbyte = 0; @@ -242,9 +243,18 @@ static ssize_t idt24x_debugfs_writer_i2c(struct file *fp, if (count > DEBUGFS_BUFFER_LENGTH) return -EINVAL; + written = simple_write_to_buffer( + idt24x_chip_fordebugfs->dbg_cache, DEBUGFS_BUFFER_LENGTH, + position, user_buffer, count); + if (written != count) { + dev_dbg(&idt24x_chip_fordebugfs->i2c_client->dev, + "write count != expected count"); + return written; + } + for (x = 0; x < count; x++) { - token[x - start] = user_buffer[x]; - if (user_buffer[x] == ' ') { + token[x - start] = idt24x_chip_fordebugfs->dbg_cache[x]; + if (idt24x_chip_fordebugfs->dbg_cache[x] == ' ') { token[x - start] = '\0'; err = idt24x_handle_i2c_debug_token( &idt24x_chip_fordebugfs->i2c_client->dev, @@ -277,9 +287,7 @@ static ssize_t idt24x_debugfs_writer_i2c(struct file *fp, "successfully wrote i2c data to chip"); } - return simple_write_to_buffer( - idt24x_chip_fordebugfs->dbg_cache, DEBUGFS_BUFFER_LENGTH, - position, user_buffer, count); + return written; } static const struct file_operations idt24x_fops_debug_action = { diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 7535e120288e92..4cab60ee3907a8 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -196,7 +196,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, struct zynqmp_pll *clk = to_zynqmp_pll(hw); u32 clk_id = clk->clk_id; const char *clk_name = clk_hw_get_name(hw); - u32 fbdiv, data; + u32 fbdiv; long rate_div, frac, m, f; int ret; const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); @@ -215,7 +215,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, /* Account for vpll_to_lpd and dp_video_ref */ if (children > 2) - WARN(1, "Two devices are using vpll which is forbidden\n"); + WARN(1, "More than two devices are using the vpll, which is forbidden\n"); rate_div = ((rate * FRAC_DIV) / parent_rate); m = rate_div / FRAC_DIV; @@ -229,8 +229,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, pr_warn_once("%s() set divider failed for %s, ret = %d\n", __func__, clk_name, ret); - data = (FRAC_DIV * f) / FRAC_DIV; - eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_DATA, clk_id, data, NULL); + eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_DATA, clk_id, f, NULL); return (rate + frac); } diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 2978dedb4c807d..35fdf42dd0a4c7 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -1175,8 +1175,10 @@ static void xilinx_cdma_start_transfer(struct xilinx_dma_chan *chan) hw = &segment->hw; - xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, hw->src_addr); - xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, hw->dest_addr); + xilinx_write(chan, XILINX_CDMA_REG_SRCADDR, (dma_addr_t) + ((u64)hw->src_addr_msb << 32 | hw->src_addr)); + xilinx_write(chan, XILINX_CDMA_REG_DSTADDR, (dma_addr_t) + ((u64)hw->dest_addr_msb << 32 | hw->dest_addr)); /* Start the transfer */ dma_ctrl_write(chan, XILINX_DMA_REG_BTT, diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c index bbc1d92108c2cf..1ea509e00742af 100644 --- a/drivers/dma/xilinx/xilinx_dpdma.c +++ b/drivers/dma/xilinx/xilinx_dpdma.c @@ -143,6 +143,7 @@ #define XILINX_DPDMA_DESC_ADDR_EXT_ADDR_SHIFT (16) #define XILINX_DPDMA_ALIGN_BYTES 256 +#define XILINX_DPDMA_LINESIZE_ALIGN_BITS 128 #define XILINX_DPDMA_NUM_CHAN 6 #define XILINX_DPDMA_PAGE_MASK ((1 << 12) - 1) @@ -1240,6 +1241,7 @@ xilinx_dpdma_chan_prep_interleaved(struct xilinx_dpdma_chan *chan, chan->xdev->desc_addr(sw_desc, sw_desc, &xt->src_start, 1); hw_desc = &sw_desc->hw; + hsize = ALIGN(hsize, XILINX_DPDMA_LINESIZE_ALIGN_BITS / 8); hw_desc->xfer_size = hsize * xt->numf; hw_desc->hsize_stride = hsize << XILINX_DPDMA_DESC_HSIZE_STRIDE_HSIZE_SHIFT; diff --git a/drivers/edac/zynqmp_ocm_edac.c b/drivers/edac/zynqmp_ocm_edac.c index a3aa57ef84a83d..4957a8c9d02d4c 100644 --- a/drivers/edac/zynqmp_ocm_edac.c +++ b/drivers/edac/zynqmp_ocm_edac.c @@ -280,7 +280,7 @@ static ssize_t zynqmp_ocm_edac_inject_fault_count_store( if (!data) return -EFAULT; - if (kstrtoint(data, 0, &ficount)) + if (kstrtouint(data, 0, &ficount)) return -EINVAL; ficount &= OCM_FICOUNT_MASK; diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index d9a768b5346be9..2485c131a0f4ef 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -236,7 +236,6 @@ static int fpga_region_program_fpga(struct fpga_region *region, { struct fpga_manager *mgr; int ret; - struct device *dev = ®ion->dev; struct reset_control *rstc; region = fpga_region_get(region); @@ -276,7 +275,7 @@ static int fpga_region_program_fpga(struct fpga_region *region, goto err_put_br; } - rstc = of_reset_control_array_get(dev->of_node, false, true); + rstc = of_reset_control_array_get(overlay, false, true); if (IS_ERR(rstc)) goto err_put_br; diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c index b0c482f5d8b635..f300c7bbb52935 100644 --- a/drivers/fpga/zynqmp-fpga.c +++ b/drivers/fpga/zynqmp-fpga.c @@ -12,7 +12,6 @@ * GNU General Public License for more details. */ -#include #include #include #include @@ -26,6 +25,11 @@ #define IXR_FPGA_DONE_MASK 0X00000008U #define IXR_FPGA_ENCRYPTION_EN 0x00000008U +/** + * struct zynqmp_fpga_priv - Private data structure + * @dev: Device data structure + * @flags: flags which is used to identify the bitfile type + */ struct zynqmp_fpga_priv { struct device *dev; u32 flags; @@ -72,10 +76,14 @@ static int zynqmp_fpga_ops_write(struct fpga_manager *mgr, if (mgr->flags & IXR_FPGA_ENCRYPTION_EN) memcpy(kbuf + size, mgr->key, ENCRYPTED_KEY_LEN); - __flush_cache_user_range((unsigned long)kbuf, - (unsigned long)kbuf + dma_size); + wmb(); /* ensure all writes are done before initiate FW call */ - ret = eemi_ops->fpga_load(dma_addr, dma_addr + size, mgr->flags); + if (mgr->flags & IXR_FPGA_ENCRYPTION_EN) + ret = eemi_ops->fpga_load(dma_addr, dma_addr + size, + mgr->flags); + else + ret = eemi_ops->fpga_load(dma_addr, size, + mgr->flags); dma_free_coherent(priv->dev, dma_size, kbuf, dma_addr); diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 655ea52d710139..1b620d03d1b4ca 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -676,10 +676,8 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio) static int __maybe_unused zynq_gpio_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - int irq = platform_get_irq(pdev, 0); - struct irq_data *data = irq_get_irq_data(irq); - struct zynq_gpio *gpio = platform_get_drvdata(pdev); + struct zynq_gpio *gpio = dev_get_drvdata(dev); + struct irq_data *data = irq_get_irq_data(gpio->irq); if (!irqd_is_wakeup_set(data)) { zynq_gpio_save_context(gpio); @@ -691,10 +689,8 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev) static int __maybe_unused zynq_gpio_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - int irq = platform_get_irq(pdev, 0); - struct irq_data *data = irq_get_irq_data(irq); - struct zynq_gpio *gpio = platform_get_drvdata(pdev); + struct zynq_gpio *gpio = dev_get_drvdata(dev); + struct irq_data *data = irq_get_irq_data(gpio->irq); int ret; if (!irqd_is_wakeup_set(data)) { @@ -842,7 +838,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) chip->free = zynq_gpio_free; chip->direction_input = zynq_gpio_dir_in; chip->direction_output = zynq_gpio_dir_out; - chip->base = -1; + chip->base = of_alias_get_id(pdev->dev.of_node, "gpio"); chip->ngpio = gpio->p_data->ngpio; /* Retrieve GPIO clock */ diff --git a/drivers/gpu/drm/xlnx/Kconfig b/drivers/gpu/drm/xlnx/Kconfig index 906c8c8c662b07..94f347418031b8 100644 --- a/drivers/gpu/drm/xlnx/Kconfig +++ b/drivers/gpu/drm/xlnx/Kconfig @@ -90,3 +90,13 @@ config DRM_XLNX_BRIDGE_SCALER if scaler is connected to an encoder. The driver provides upscaling, down scaling and no scaling functionality through bridge layer. + +config DRM_XLNX_BRIDGE_VTC + tristate "Xilinx DRM VTC Driver" + depends on DRM_XLNX_BRIDGE + help + DRM brige driver for Xilinx Video Timing Controller. Choose + this option to make VTC a part of the CRTC in display pipeline. + Currently the support is added to the Xilinx Video Mixer and + Xilinx PL display CRTC drivers. This driver provides ability + to generate timings through the bridge layer. diff --git a/drivers/gpu/drm/xlnx/Makefile b/drivers/gpu/drm/xlnx/Makefile index 69aecb08ebe910..1d80be7d3e70d5 100644 --- a/drivers/gpu/drm/xlnx/Makefile +++ b/drivers/gpu/drm/xlnx/Makefile @@ -6,6 +6,8 @@ obj-$(CONFIG_DRM_XLNX_BRIDGE_CSC) += xlnx_csc.o obj-$(CONFIG_DRM_XLNX_BRIDGE_SCALER) += xlnx_scaler.o +obj-$(CONFIG_DRM_XLNX_BRIDGE_VTC) += xlnx_vtc.o + obj-$(CONFIG_DRM_XLNX_DSI) += xlnx_dsi.o obj-$(CONFIG_DRM_XLNX_MIXER) += xlnx_mixer.o diff --git a/drivers/gpu/drm/xlnx/xlnx_bridge.c b/drivers/gpu/drm/xlnx/xlnx_bridge.c index ad706a5666bf0f..6ee462ada6768e 100644 --- a/drivers/gpu/drm/xlnx/xlnx_bridge.c +++ b/drivers/gpu/drm/xlnx/xlnx_bridge.c @@ -52,6 +52,7 @@ struct xlnx_bridge_helper { static struct xlnx_bridge_helper helper; +struct videomode; /* * Client functions */ @@ -209,6 +210,34 @@ int xlnx_bridge_get_output_fmts(struct xlnx_bridge *bridge, } EXPORT_SYMBOL(xlnx_bridge_get_output_fmts); +/** + * xlnx_bridge_set_timing - Set the video timing + * @bridge: bridge to set + * @vm: Videomode + * + * Set the video mode so that timing can be generated using this + * by the video timing controller. + * + * Return: 0 on success. -ENOENT if no callback, -EFAULT if in error state, + * or return code from callback. + */ +int xlnx_bridge_set_timing(struct xlnx_bridge *bridge, struct videomode *vm) +{ + if (!bridge) + return 0; + + if (helper.error) + return -EFAULT; + + if (bridge->set_timing) { + bridge->set_timing(bridge, vm); + return 0; + } + + return -ENOENT; +} +EXPORT_SYMBOL(xlnx_bridge_set_timing); + /** * of_xlnx_bridge_get - Get the corresponding Xlnx bridge instance * @bridge_np: The device node of the bridge device diff --git a/drivers/gpu/drm/xlnx/xlnx_bridge.h b/drivers/gpu/drm/xlnx/xlnx_bridge.h index 2dd5ca196a9a01..64330169bd2228 100644 --- a/drivers/gpu/drm/xlnx/xlnx_bridge.h +++ b/drivers/gpu/drm/xlnx/xlnx_bridge.h @@ -19,6 +19,8 @@ #ifndef _XLNX_BRIDGE_H_ #define _XLNX_BRIDGE_H_ +struct videomode; + struct xlnx_bridge_debugfs_file; /** @@ -32,6 +34,7 @@ struct xlnx_bridge_debugfs_file; * @get_input_fmts: callback to get supported input formats. * @set_output: callback to set the output * @get_output_fmts: callback to get supported output formats. + * @set_timing: callback to set timing in connected video timing controller. * @debugfs_file: for debugfs support */ struct xlnx_bridge { @@ -48,6 +51,7 @@ struct xlnx_bridge { u32 width, u32 height, u32 bus_fmt); int (*get_output_fmts)(struct xlnx_bridge *bridge, const u32 **fmts, u32 *count); + int (*set_timing)(struct xlnx_bridge *bridge, struct videomode *vm); struct xlnx_bridge_debugfs_file *debugfs_file; }; @@ -75,6 +79,7 @@ int xlnx_bridge_set_output(struct xlnx_bridge *bridge, u32 width, u32 height, u32 bus_fmt); int xlnx_bridge_get_output_fmts(struct xlnx_bridge *bridge, const u32 **fmts, u32 *count); +int xlnx_bridge_set_timing(struct xlnx_bridge *bridge, struct videomode *vm); struct xlnx_bridge *of_xlnx_bridge_get(struct device_node *bridge_np); void of_xlnx_bridge_put(struct xlnx_bridge *bridge); @@ -141,6 +146,14 @@ static inline int xlnx_bridge_get_output_fmts(struct xlnx_bridge *bridge, return 0; } +static int xlnx_bridge_set_timing(struct xlnx_bridge *bridge, + struct videomode *vm) +{ + if (bridge) + return -ENODEV; + return 0; +} + static inline struct xlnx_bridge * of_xlnx_bridge_get(struct device_node *bridge_np) { diff --git a/drivers/gpu/drm/xlnx/xlnx_mixer.c b/drivers/gpu/drm/xlnx/xlnx_mixer.c index 0ab5cb605dfc5f..ad361242976503 100644 --- a/drivers/gpu/drm/xlnx/xlnx_mixer.c +++ b/drivers/gpu/drm/xlnx/xlnx_mixer.c @@ -25,8 +25,10 @@ #include #include #include -#include "xlnx_drv.h" +#include