Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
different patching mechanism, battery and thermal zones
- Loading branch information
Krystian Lewandowski
committed
Sep 7, 2019
1 parent
44651aa
commit db91f66
Showing
10 changed files
with
124 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
||
&axp803 { | ||
battery_power_supply: battery-power-supply { | ||
compatible = "x-powers,axp803-battery-power-supply", | ||
"x-powers,axp813-battery-power-supply"; | ||
status = "disabled"; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
||
&battery_power_supply { | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
/dts-v1/; | ||
/plugin/; | ||
|
||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include <dt-bindings/thermal/thermal.h> | ||
|
||
/ { | ||
compatible = "allwinner,sun50i-a64"; | ||
}; | ||
|
||
&{/} { | ||
thermal-zones { | ||
cpu-thermal { | ||
/* milliseconds */ | ||
polling-delay-passive = <250>; | ||
polling-delay = <1000>; | ||
thermal-sensors = <&ths 0>; | ||
|
||
trips { | ||
cpu_warm: cpu_warm { | ||
temperature = <65000000>; | ||
hysteresis = <2000000>; | ||
type = "passive"; | ||
}; | ||
|
||
cpu_hot_pre: cpu_hot_pre { | ||
temperature = <70000000>; | ||
hysteresis = <2000000>; | ||
type = "passive"; | ||
}; | ||
|
||
cpu_hot: cpu_hot { | ||
temperature = <75000000>; | ||
hysteresis = <2000000>; | ||
type = "passive"; | ||
}; | ||
|
||
cpu_very_hot: cpu_very_hot { | ||
temperature = <90000000>; | ||
hysteresis = <2000000>; | ||
type = "passive"; | ||
}; | ||
}; | ||
|
||
cooling-maps { | ||
cpu_warm_limit_cpu { | ||
trip = <&cpu_warm>; | ||
cooling-device = <&cpu0 THERMAL_NO_LIMIT 2>; | ||
}; | ||
|
||
cpu_hot_pre_limit_cpu { | ||
trip = <&cpu_hot_pre>; | ||
cooling-device = <&cpu0 2 3>; | ||
}; | ||
|
||
cpu_hot_limit_cpu { | ||
trip = <&cpu_hot>; | ||
cooling-device = <&cpu0 3 4>; | ||
}; | ||
|
||
cpu_very_hot_pre_limit_cpu { | ||
trip = <&cpu_very_hot>; | ||
cooling-device = <&cpu0 5 6>; | ||
}; | ||
|
||
cpu_very_hot_limit_cpu { | ||
trip = <&cpu_very_hot>; | ||
cooling-device = <&cpu0 7 THERMAL_NO_LIMIT>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,52 @@ | ||
#!/usr/bin/env ksh | ||
|
||
FLAVOR=aarch64 | ||
export FLAVOR=aarch64 | ||
UBOOT_OVERLAYS_PATH=$(pwd)/overlays | ||
|
||
cd /usr/ports/sysutils/u-boot | ||
WRKDIST=$(make show=WRKDIST) | ||
echo ${WRKDIST} | ||
make uninstall | ||
make clean=all | ||
make patch | ||
cd - | ||
|
||
WRKDIST_OVERLAYS_PATH=${WRKDIST}/arch/arm/dts/overlays/arm64 | ||
WRKDIST_DTS_PATH="${WRKDIST}/arch/arm/dts/" | ||
WRKDIST_OVERLAYS_PATH="${WRKDIST}/arch/arm/dts/overlays/" | ||
|
||
if [ -z "${WRKDIST}" ]; then | ||
echo "no WRKDIST" | ||
exit 1 | ||
echo "no WRKDIST" | ||
exit 1 | ||
fi | ||
|
||
cd ${WRKDIST} | ||
cd "${WRKDIST}" | ||
|
||
rm -rf ${WRKDIST_OVERLAYS_PATH} | ||
mkdir -p ${WRKDIST_OVERLAYS_PATH} | ||
rm -rf "${WRKDIST_OVERLAYS_PATH}" | ||
mkdir -p "${WRKDIST_OVERLAYS_PATH}" | ||
|
||
for F in $(find ${UBOOT_OVERLAYS_PATH} -name "sun50i-a64*.dtso"); do | ||
tail -n+3 ${F} > ${WRKDIST_OVERLAYS_PATH}/$(basename ${F}.updated) | ||
echo "#include <overlays/arm64/$(basename ${F}).updated>" >> ${WRKDIST}/arch/arm/dts/sun50i-a64.dtsi | ||
for P in $(find "${UBOOT_OVERLAYS_PATH}" -name "*.dtso"); do | ||
F=$(basename "${P}") | ||
SUFFIX=${F##*-} | ||
TARGET_DTS=${WRKDIST_DTS_PATH}${F%-"${SUFFIX}"}.dts | ||
TARGET_DTSI=${WRKDIST_DTS_PATH}${F%-"${SUFFIX}"}.dtsi | ||
TARGET="" | ||
|
||
if [ -f "${TARGET_DTS}" ]; then | ||
TARGET="${TARGET_DTS}" | ||
elif [ -f "${TARGET_DTSI}" ]; then | ||
TARGET="${TARGET_DTSI}" | ||
fi | ||
|
||
if [ ! -z "${TARGET}" ]; then | ||
cp "${P}" "${WRKDIST_OVERLAYS_PATH}/${F}" | ||
echo -n "Adding ${F} include to $(basename ${TARGET})... " | ||
echo "#include <overlays/${F}>" >> ${TARGET} | ||
echo "OK" | ||
else | ||
echo "Couldn't fid target for ${P} overlay!" | ||
fi | ||
done | ||
|
||
cd /usr/ports/sysutils/u-boot | ||
make install | ||
cd - |