Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V17 luci eht #17

Merged
Merged

Commits on Oct 27, 2024

  1. mediatek: add kmod-thermal for BPI-R4 device

    Without adding that kmod, build fails with an error:
    
        Collected errors:
         * pkg_hash_check_unresolved: cannot find dependency kmod-thermal for kmod-hwmon-pwmfan
         * pkg_hash_fetch_best_installation_candidate: Packages for kmod-hwmon-pwmfan found, but incompatible with the architectures configured
         * opkg_install_cmd: Cannot install package kmod-hwmon-pwmfan.
    
    It is because, the kmod-thermal is marked as module:
    
        CONFIG_PACKAGE_kmod-thermal=m
    
    After adding it as dependency to the BPI-R4 device, the problem
    disappear.
    
    Signed-off-by: Daniel Pawlik <[email protected]>
    (cherry picked from commit c124384)
    danpawlik committed Oct 27, 2024
    Configuration menu
    Copy the full SHA
    54c1ba9 View commit details
    Browse the repository at this point in the history
  2. mediatek/filogic: crypto/safexcel add support

    The filogic banana-rpi4 has a crypto module that makes use of safexcel/eip197 to date the module doesn't load.
    
    Refactored 5.4 patch from Mediatek - https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/refs/heads/master/21.02/files/target/linux/mediatek/patches-5.4/999-2706-crypto-add-eip197-inside-secure-support.patch
    
    Changes to base driver code
    
    . Release Firmware Loop:
    + for (j = 0; j < i; j++)
    +     release_firmware(fw[j]);
    
    After writing firmware, the added loop releases the allocated firmware resources. This addition helps in reducing memory usage and potential resource leaks by ensuring that firmware that is no longer needed is freed properly
    
    . AXI Burst Size and Cache Settings:
    + /* Clear axi_burst_size and rx_burst_size */
    + val &= 0xffffff00;
    + /* Set axi_burst_size = 3, rx_burst_size = 3 */
    + val |= EIP197_MST_CTRL_RD_CACHE(3);
    + val |= EIP197_MST_CTRL_WD_CACHE(3);
    
    The added lines clear existing burst size settings and then set both axi_burst_size and rx_burst_size to 3. This change aims to optimize data transactions by configuring suitable burst sizes, potentially improving performance (tbc)
    
    . Clock Forcing Mechanism:
    
    + /* Allow clocks to be forced on for EIP197 */
    + if (priv->flags & SAFEXCEL_HW_EIP197) {
    +     writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON);
    +     writel(0xffffffff, EIP197_HIA_GEN_CFG(priv) + EIP197_FORCE_CLOCK_ON2);
    + }
    
    Forcing clocks on for the EIP197 is introduced. This ensures that the clocks remain active, likely improving stability and reliability in certain hardware environments where clock gating might have caused issues.
    
    . Resource Acquisition and Mapping:
    
    + struct resource *res;
    ...
    + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    + if (!res)
    +     return -EINVAL;
    + priv->base = devm_ioremap(dev, res->start, resource_size(res));
    - priv->base = devm_platform_ioremap_resource(pdev, 0);
    
    The previous resource mapping (devm_platform_ioremap_resource) is replaced with manual acquisition (platform_get_resource) and mapping (devm_ioremap).
    This provides finer control over the resource, allowing for better error handling and making it possible to check the validity of the resource before proceeding.
    
    New Macros for Clock Control:
    + #define EIP197_FORCE_CLOCK_ON2  0xffd8
    + #define EIP197_FORCE_CLOCK_ON   0xffe8
    
    Two new macro definitions, EIP197_FORCE_CLOCK_ON and EIP197_FORCE_CLOCK_ON2, are introduced. These are used to address the corresponding registers that manage the forced clocking mechanism.
    
    Tested on the banana rpi4
    
    Signed-off-by: Rudy Andram <[email protected]>
    (cherry picked from commit 28fbbce)
    rmandrad authored and danpawlik committed Oct 27, 2024
    Configuration menu
    Copy the full SHA
    b813371 View commit details
    Browse the repository at this point in the history