Merge branch 'dos-hacks' into HEAD

parents 8652f28a 47b8d48f
Pipeline #63458 passed with stage
in 63 minutes and 6 seconds
......@@ -17,20 +17,28 @@ before_script:
- librem5
build:aarch64:
<<: *tags
tags:
- librem5
stage: build
allow_failure: true
variables:
CROSS_BUILD: "ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-"
# allow_failure: true
# variables:
# CROSS_BUILD: "ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-"
# script:
# - make ${CROSS_BUILD} librem5_defconfig
# - KCFLAGS="-Werror" make -j 4 ${CROSS_BUILD} Image dtbs modules
# - make -j 4 ${CROSS_BUILD} INSTALL_MOD_PATH=modules/ modules_install
script:
- make ${CROSS_BUILD} librem5_defconfig
- KCFLAGS="-Werror" make -j 4 ${CROSS_BUILD} Image dtbs modules
- make -j 4 ${CROSS_BUILD} INSTALL_MOD_PATH=modules/ modules_install
- git clean -dfx
- git checkout -f
- rm -f ../* || true
- rm -rf "${WORKING_DIR}"; mkdir -p "${WORKING_DIR}"
- debian/rules debian/control
- dch -l +gitlabci "Gitlab ci amd64 build of ${CI_COMMIT_SHA}"
- dpkg-buildpackage -j4 -uc -us -B --host-arch=arm64
- cp -l ../*.deb ../*.changes ../*.buildinfo "${WORKING_DIR}/"
artifacts:
paths:
- arch/arm64/boot/Image
- arch/arm64/boot/dts/freescale/imx8mq-librem5*.dtb
- modules/
- "${WORKING_DIR}"
expire_in: 1 week
build:deb:
......
......@@ -35,7 +35,7 @@ reg_camera1_pwr_en: regulator-camera1-pwr-en {
&a53_opp_table {
opp-1000000000 {
opp-microvolt = <1000000>;
opp-microvolt = <930000>;
};
};
......
......@@ -77,6 +77,7 @@ red {
label = "red:status";
max-brightness = <248>;
pwms = <&pwm3 0 50000>;
panic-indicator;
};
};
......@@ -504,6 +505,9 @@ opp-100M {
opp-800M {
opp-hz = /bits/ 64 <800000000>;
};
opp-801M {
opp-hz = /bits/ 64 <800000001>;
};
};
};
......@@ -1129,8 +1133,8 @@ buck1_reg: BUCK1 {
regulator-boot-on;
regulator-ramp-delay = <1250>;
rohm,dvs-run-voltage = <900000>;
rohm,dvs-idle-voltage = <850000>;
rohm,dvs-suspend-voltage = <800000>;
rohm,dvs-idle-voltage = <820000>;
rohm,dvs-suspend-voltage = <820000>;
regulator-always-on;
};
......@@ -1140,7 +1144,7 @@ buck2_reg: BUCK2 {
regulator-max-microvolt = <1300000>;
regulator-boot-on;
regulator-ramp-delay = <1250>;
rohm,dvs-run-voltage = <1000000>;
rohm,dvs-run-voltage = <930000>;
rohm,dvs-idle-voltage = <900000>;
regulator-always-on;
};
......@@ -1150,14 +1154,14 @@ buck3_reg: BUCK3 {
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-boot-on;
rohm,dvs-run-voltage = <900000>;
rohm,dvs-run-voltage = <860000>;
};
buck4_reg: BUCK4 {
regulator-name = "buck4";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
rohm,dvs-run-voltage = <1000000>;
rohm,dvs-run-voltage = <860000>;
};
buck5_reg: BUCK5 {
......@@ -1772,3 +1776,9 @@ &wdog1 {
fsl,ext-reset-output;
status = "okay";
};
&a53_opp_table {
opp-1500000000 {
opp-microvolt = <930000>;
};
};
......@@ -1252,6 +1252,9 @@ opp-133M {
opp-400M {
opp-hz = /bits/ 64 <400000000>;
};
opp-401M {
opp-hz = /bits/ 64 <400000001>;
};
opp-800M {
opp-hz = /bits/ 64 <800000000>;
};
......@@ -1506,11 +1509,15 @@ gic: interrupt-controller@38800000 {
ddrc: memory-controller@3d400000 {
compatible = "fsl,imx8mq-ddrc", "fsl,imx8m-ddrc";
reg = <0x3d400000 0x400000>;
clock-names = "core", "pll", "alt", "apb";
clock-names = "core", "pll", "alt", "apb", "main_axi", "ahb", "osc_25m", "sys2_pll_333m";
clocks = <&clk IMX8MQ_CLK_DRAM_CORE>,
<&clk IMX8MQ_DRAM_PLL_OUT>,
<&clk IMX8MQ_CLK_DRAM_ALT>,
<&clk IMX8MQ_CLK_DRAM_APB>;
<&clk IMX8MQ_CLK_DRAM_APB>,
<&clk IMX8MQ_CLK_MAIN_AXI>,
<&clk IMX8MQ_CLK_AHB>,
<&clk IMX8MQ_CLK_25M>,
<&clk IMX8MQ_SYS2_PLL_333M>;
fsl,ddr-pmu = <&ddr_pmu>;
};
......
......@@ -77,6 +77,10 @@ struct imx8m_ddrc {
struct clk *dram_pll;
struct clk *dram_alt;
struct clk *dram_apb;
struct clk *main_axi;
struct clk *ahb;
struct clk *sys2_pll_333m;
struct clk *osc_25m;
int freq_count;
struct imx8m_ddrc_freq freq_table[IMX8M_DDRC_MAX_FREQ_COUNT];
......@@ -261,7 +265,7 @@ static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags)
dev_pm_opp_put(new_opp);
old_freq = clk_get_rate(priv->dram_core);
if (*freq == old_freq)
if (DIV_ROUND_CLOSEST(*freq, 250000) == DIV_ROUND_CLOSEST(old_freq, 250000))
return 0;
freq_info = imx8m_ddrc_find_freq(priv, *freq);
......@@ -278,13 +282,21 @@ static int imx8m_ddrc_target(struct device *dev, unsigned long *freq, u32 flags)
if (ret)
dev_err(dev, "ddrc failed freq switch to %lu from %lu: error %d. now at %lu\n",
*freq, old_freq, ret, new_freq);
else if (*freq != new_freq)
else if (DIV_ROUND_CLOSEST(*freq, 250000) != DIV_ROUND_CLOSEST(new_freq, 250000))
dev_err(dev, "ddrc failed freq update to %lu from %lu, now at %lu\n",
*freq, old_freq, new_freq);
else
dev_dbg(dev, "ddrc freq set to %lu (was %lu)\n",
*freq, old_freq);
if (DIV_ROUND_CLOSEST(new_freq, 250000) == 100) {
clk_set_rate(priv->ahb, 22222222);
clk_set_parent(priv->main_axi, priv->osc_25m);
} else {
clk_set_rate(priv->ahb, 133333333);
clk_set_parent(priv->main_axi, priv->sys2_pll_333m);
}
return ret;
}
......@@ -545,6 +557,30 @@ static int imx8m_ddrc_probe(struct platform_device *pdev)
dev_err(dev, "failed to fetch apb clock: %d\n", ret);
return ret;
}
priv->main_axi = devm_clk_get(dev, "main_axi");
if (IS_ERR(priv->main_axi)) {
ret = PTR_ERR(priv->main_axi);
dev_err(dev, "failed to fetch main_axi clock: %d\n", ret);
return ret;
}
priv->ahb = devm_clk_get(dev, "ahb");
if (IS_ERR(priv->ahb)) {
ret = PTR_ERR(priv->ahb);
dev_err(dev, "failed to fetch ahb clock: %d\n", ret);
return ret;
}
priv->osc_25m = devm_clk_get(dev, "osc_25m");
if (IS_ERR(priv->osc_25m)) {
ret = PTR_ERR(priv->osc_25m);
dev_err(dev, "failed to fetch osc_25m clock: %d\n", ret);
return ret;
}
priv->sys2_pll_333m = devm_clk_get(dev, "sys2_pll_333m");
if (IS_ERR(priv->sys2_pll_333m)) {
ret = PTR_ERR(priv->sys2_pll_333m);
dev_err(dev, "failed to fetch sys2_pll_333m clock: %d\n", ret);
return ret;
}
ret = dev_pm_opp_of_add_table(dev);
if (ret < 0) {
......
......@@ -213,8 +213,9 @@ static int lm3560_brightness_set(struct led_classdev *cdev, enum led_brightness
}
ret = regmap_update_bits(priv->regmap, LM3560_TORCH_BRIGHT_REG,
LM3560_TORCH_BRIGHT_LED2_MASK,
((brightness - 1) << LM3560_TORCH_BRIGHT_LED2_SHIFT));
LM3560_TORCH_BRIGHT_LED2_MASK | LM3560_TORCH_BRIGHT_LED1_MASK,
((brightness - 1) << LM3560_TORCH_BRIGHT_LED2_SHIFT) |
((brightness - 1) << LM3560_TORCH_BRIGHT_LED1_SHIFT));
if (ret < 0)
goto out;
......@@ -222,7 +223,7 @@ static int lm3560_brightness_set(struct led_classdev *cdev, enum led_brightness
LM3560_ENABLE_MASK |
LM3560_ENABLE_LED1_FLAG |
LM3560_ENABLE_LED2_FLAG,
LM3560_ENABLE_LED2_FLAG |
LM3560_ENABLE_LED1_FLAG | LM3560_ENABLE_LED2_FLAG |
LM3560_ENABLE_TORCH);
out:
mutex_unlock(&priv->lock);
......@@ -287,7 +288,7 @@ static int lm3560_flash_brightness_set(struct led_classdev_flash *fled_cdev, u32
brightness_val = brightness / LM3560_FLASH_BRIGHT_STEP_uA;
ret = regmap_update_bits(priv->regmap, LM3560_FLASH_BRIGHT_REG,
LM3560_FLASH_BRIGHT_LED2_MASK,
LM3560_FLASH_BRIGHT_LED2_MASK | LM3560_FLASH_BRIGHT_LED1_MASK,
((brightness_val - 1) << LM3560_FLASH_BRIGHT_LED1_SHIFT) |
((brightness_val - 1) << LM3560_FLASH_BRIGHT_LED2_SHIFT));
......
......@@ -938,8 +938,6 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
if (old_freq == freq) {
if (!opp_table->required_opp_tables && !opp_table->regulators &&
!opp_table->paths) {
dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
__func__, freq);
ret = 0;
goto put_opp_table;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment