- Nov 08, 2024
-
-
Nícolas F. R. A. Prado authored
The current DT has the wakeup-source and mediatek,syscon-wakeup properties in the XHCI nodes, which configures USB wakeup after powering down the XHCI hardware block. However, since the XHCI controller is behind an MTU3 (USB3 DRD controller), the MTU3 only gets powered down after USB wakeup has been configured, causing the system to detect a wakeup, and results in broken suspend support as the system resumes immediately. Move the wakeup properties to the MTU3 nodes so that USB wakeup is only enabled after the MTU3 has powered down. With this change in place, it is possible to suspend and resume, and also to wakeup through USB, as tested on the Google Steelix (Lenovo 300e Yoga Chromebook Gen 4). Fixes: f6c3e61c ("arm64: dts: mediatek: mt8186: Add MTU3 nodes") Reported-by: Wojciech Macek <wmacek@google.com> Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
-
Add support for Host Software Queue (HSQ) and enable it when the controller instance does not have Command Queue Engine HW support. It was chosen to enable HSQ only for eMMC and SD/MicroSD cards and not for SDIO as performance improvements are seen only for the former. Performance was measured with a SanDisk Extreme Ultra A2 MicroSD card in a MediaTek MT8195T Acer Chromebook Spin 513 (CP513-2H), by running FIO (bs=4k) on an ArchLinux userspace. .... Summarizing .... Random read: +24.28% IOPS, +24.29% BW Sequential read: +3.14% IOPS, +3.49% BW Random RW (avg): +50.53% IOPS, +50.68% BW Below, more data from the benchmarks. Before: - Random read: IOPS=1643, BW=6574KiB/s bw ( KiB/s): min= 4578, max= 7440, per=99.95%, avg=6571.55, stdev=74.16, samples=953 iops : min= 1144, max= 1860, avg=1642.14, stdev=18.54, samples=953 lat (msec) : 100=0.01%, 250=0.12%, 500=0.38%, 750=97.89%, 1000=1.44%, 2000=0.16% - Sequential read: IOPS=19.1k, BW=74.4MiB/s bw ( KiB/s): min=12288, max=118483, per=100.00%, avg=76293.38, stdev=1971.42, samples=956 iops : min= 3072, max=29620, avg=19072.14, stdev=492.87, samples=956 lat (msec) : 4=0.01%, 10=0.01%, 20=0.21%, 50=23.95%, 100=75.67%, 250=0.05%, 500=0.03%, 750=0.08% - Random R/W: read: IOPS=282, BW=1129KiB/s (1156kB/s) write: IOPS=284, BW=1136KiB/s read bw ( KiB/s): min= 31, max= 3496, per=100.00%, avg=1703.67, stdev=155.42, samples=630 read iops : min= 7, max= 873, avg=425.22, stdev=38.85, samples=630 wri bw ( KiB/s): min= 31, max= 3443, per=100.00%, avg=1674.27, stdev=164.23, samples=644 wri iops : min= 7, max= 860, avg=417.87, stdev=41.03, samples=644 lat (msec) : 250=0.13%, 500=0.44%, 750=0.84%, 1000=22.29%, 2000=74.01%, >=2000=2.30% After: - Random read: IOPS=2042, BW=8171KiB/s bw ( KiB/s): min= 4907, max= 9072, per=99.94%, avg=8166.80, stdev=93.77, samples=954 iops : min= 1226, max= 2268, avg=2040.78, stdev=23.41, samples=954 lat (msec) : 100=0.03%, 250=0.13%, 500=52.88%, 750=46.64%, 1000=0.32% - Sequential read: IOPS=19.7k, BW=77.0MiB/s bw ( KiB/s): min=67980, max=94248, per=100.00%, avg=78894.27, stdev=1475.07, samples=956 iops : min=16994, max=23562, avg=19722.45, stdev=368.76, samples=956 lat (msec) : 4=0.01%, 10=0.01%, 20=0.05%, 50=28.78%, 100=71.14%, 250=0.01%, 500=0.02% - Random R/W: read: IOPS=424, BW=1699KiB/s write: IOPS=428, BW=1714KiB/s read bw ( KiB/s): min= 228, max= 2856, per=100.00%, avg=1796.60, stdev=112.59, samples=901 read iops : min= 54, max= 712, avg=447.81, stdev=28.21, samples=901 wri bw ( KiB/s): min= 28, max= 2904, per=100.00%, avg=1780.11, stdev=128.27, samples=916 wri iops : min= 4, max= 724, avg=443.69, stdev=32.14, samples=916 Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Add MT8188 to the allowlist to use this driver's VGPU regulator coupling mechanism on this SoC. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Checking of_machine_is_compatible() for each machine is just an open coded version of of_machine_compatible_match(): add a new allowlist array of compatibles and iteratively check those by calling said function. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Instead of calculating the number of full days since Sunday with (days + 4) % 7, read (and write) that to the RTC Day-of-week Time Counter register (RTC_TC_DOW). Some transformation (addition and subtraction for set/get) is still done, as this register's range is [1..7], while the tm_wday in struct tm's range is [0..6]. Please note that this was added only to set_time() and read_time() callbacks because set_alarm() and read_alarm() are setting a bit in RTC_AL_MASK to ignore DOW for RTC HW alarms for unknown reasons. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Add the RTC hardware range parameters to enable the possibility of using the `start-year` devicetree property which, if present, will set the start_secs parameter by overriding the defaults that this driver is setting; To keep compatibility with (hence have the same date/time reading as) the old behavior, set: - range_min to 1900-01-01 00:00:00 - range_max to 2027-12-31 23:59:59 (HW year max range is 0-127) - start_secs defaulting to 1968-01-02 00:00:00 Please note that the oddness of starting from January 2nd is not a hardware quirk and it's done only to get the same date/time reading as an RTC which time was set before this commit. Also remove the RTC_MIN_YEAR_OFFSET addition and subtraction in callbacks set_time() and read_time() respectively, as now this is already done by the API. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
There is an error path that checks whether the return value is -EPROBE_DEFER to decide whether to print the error message: that is exactly open-coding dev_err_probe(), so, switch to that. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Move, where possible, the initialization of struct cmdq_instruction variables to their declaration to compress the code. While at it, also change an instance of open-coded mask to use the GENMASK() macro instead, and instances of `ret = func(); return ret;` to the equivalent (but shorter) `return func()`. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Calling cmdq packet builders with an unsupported event number, or without left/right operands (in the case of logic commands) means that the caller (another driver) wants to perform an unsupported operation, so this means that the caller must be fixed instead. Anyway, such checks are here for safety and, unless any driver bug or any kind of misconfiguration is present, will always be false so add a very unlikely hint for those. Knowing that CPUs' branch predictors (and compilers, anyway) are indeed smart about these cases, this is done mainly for human readability purposes. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Move the CMDQ_CODE_MASK packet build and append logic to a new cmdq_pkt_mask() function; this reduces code duplication by 5x. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Use the kernel provided dev_err_ptr_probe() and dev_err_probe() in all probe error return paths where possible. While at it, also beautify the device link error message. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
This is a defconfig for all MediaTek Chromebooks, running on ArchLinux, Debian, ChromiumOS or PostmarketOS. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
- Oct 03, 2024
-
-
AngeloGioacchino Del Regno authored
Add support for restricting the port's link width by specifying the num-lanes devicetree property in the PCIe node. The setting is done in the GEN_SETTINGS register (in the driver named as PCIE_SETTING_REG), where each set bit in [11:8] activates a set of lanes (from bits 11 to 8 respectively, x16/x8/x4/x2). Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add support for respecting the max-link-speed devicetree property, forcing a maximum speed (Gen) for a PCI-Express port. Since the MediaTek PCIe Gen3 controllers also expose the maximum supported link speed in the PCIE_BASE_CFG register, if property max-link-speed is specified in devicetree, validate it against the controller capabilities and proceed setting the limitations only if the wanted Gen is lower than the maximum one that is supported by the controller itself (otherwise it makes no sense!). Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
This replaces all occurrences of (1 << x) with BIT(x). No functional changes. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Like VDOSYS0/1, the VPPSYS0 and VPPSYS1 are syscon nodes, as described by the mediatek,mmsys binding: fix the node name to be syscon@address and add "syscon" to the list of compatible strings for both VPPSYS0 and VPPSYS1. Fixes: 9461e0ca ("arm64: dts: Add MediaTek MT8188 dts and evaluation board and Makefile") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Describe the PMIC-integrated Auxiliary Analog to Digital Converter subdevice node. Full description is available in the mediatek,mt6359-auxadc.yaml binding relative to that hardware. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Enable the Audio Front End (AFE) and add support for the PMIC integrated sound card, exposed at the onboard 4-pole 3.5mm jack. Also add a comment note signaling that the support for HDMI and DisplayPort audio is missing; this is because: - The HDMI TX controller is not yet enabled and, at the time of writing, there's no driver yet; - The DisplayPort is not yet enabled, but the driver is available upstream and will be added at a later time. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Load the MT8195 SCP firmware, as it is compatible with MT8395, and also add the SCP_VREQ_VAO pin to set it as input as required: this enables both vcodec with stateless decoding and stateful encoding with the same codecs supported by the MT8195 SoC. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add aliases for MMC0 and MMC1 to get consistent device numbers for the eMMC and for the MicroSD card. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Enable the UFS PHY and UFS controller with its required power supplies to enable using the UFS card on this board. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add a node for the Universal Flash Storage controller and keep it disabled by default. While at it, also change the UFS PHY node to use the right clocks for unipro and mp to improve reliability on platforms that don't enable, or that disable, UFS in the bootloader before booting the kernel. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
-
AngeloGioacchino Del Regno authored
Add support for a DSI display connected to the DSI0 output. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The display IPs in MT8195 are flexible and those support being interconnected with different instances of DDP IPs and/or with different DDP IPs, forming a full Display Data Path that ends with an actual display output, which is board-specific. Add a common graph in the main mt8195.dtsi DT, shared between all of the currently supported boards (including IoT and EVK) to avoid cluttering device-specific DTs, and add the relevant board-specific graph in mt8195-cherry, shared between all of the currently supported MT8195 Chromebooks. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add a node for the Dynamic Voltage and Frequency Scaling Resource Collector (DVFSRC) and subnodes for the DVFSRC regulators, supplying power to CPU Cores and SCP, and External Memory Interface (EMI) interconnect. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Chun-Kuang Hu authored
Use cmdq_pkt_create() and cmdq_pkt_destroy() common function instead of implementing mdp3 version. Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org> [Angelo: Fixup for parallel pipe MDP3 support] Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
Chun-Kuang Hu authored
In order to have fine-grained control, use cmdq_pkt_eoc() and cmdq_pkt_jump_rel() to replace cmdq_pkt_finalize(). Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
-
AngeloGioacchino Del Regno authored
When probing multi-core SCP, this driver is parsing all sub-nodes of the scp-cluster node, but one of those could be not an actual SCP core and that would make the entire SCP cluster to fail probing for no good reason. To fix that, in scp_add_multi_core() treat a subnode as a SCP Core by parsing only available subnodes having compatible "mediatek,scp-core". Fixes: 1fdbf0cd ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The System Companion Processor block in MT8195 has 768KB of L2TCM shared with the two SCP cores. Fix the sram iospace to be 768KB instead of 1MB long. Fixes: 867477a5 ("arm64: dts: mt8195: Add scp node") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
The drivers and bindings acquired support for specifying audio hardware and links in device tree: describe and link the sound related HW of this machine. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Move the simple component check to a new mtk_ddp_is_simple_comp() internal helper to reduce code duplication. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
Add a new mtk_ddp_comp_destroy() function and call it in the teardown path of mtk_drm_drv to make sure that we unmap the iospace of the simple DDP components. While at it, also fix iounmapping on mtk_ddp_comp_init() error path. Fixes: ff139560 ("drm/mediatek: Move mtk_ddp_comp_init() from sub driver to DRM driver") Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
As per Stephen Boyd's request, add the drivers/clk/mediatek folder to ARM/Mediatek SoC support. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
-
AngeloGioacchino Del Regno authored
Add the machine compatible and topology filename for the Google Steelix MT8186 Chromebook to load the correct SOF topology file. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
-
AngeloGioacchino Del Regno authored
-
Jiaxin Yu authored
Add audio support for it6505 1. Bridge to hdmi-codec to support audio feature. At the same time, the function of automatically detecting audio is removed. 2. It is observed that some DP-to-HDMI dongles will get into bad states if sending InfoFrame without audio data. Defer to enable it6505's audio feature when PCM triggers START or RESUME. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
-
Jiaxin Yu authored
Use SND_SOC_DAPM_LINE instead of SND_SOC_DAPM_OUTPUT to trigger DAPM events to hdmi-codec when userspace control the DPAM pin. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
-
Jiaxin Yu authored
If the speaker and hdmi are connect to the same port of I2S, when try to switch to speaker playback, we will find that hdmi is always turned on automatically. The connection as follows: ==> hdmi-codec ==> it6505(HDMI output) DL1(FE) ==> I2S3(BE) ==> rt1015p(SPEAKER output) So in order to separately control their power on/off, we have added a dapm widget to notify each output. Also the machine driver need add a _PIN_SWITCH() on the output of the device that will cause DAPM to keep the device powered down when not in use. The purpose of adding .trigger callback here is to enable hdmi-codec to notify the dp output driver to power on or off device. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
-