RPi: Improve board revision detection (#681)
Revision detection is done at runtime, the configure script has been simplified to reflect this.
This commit is contained in:
committed by
Patrick Fallberg
parent
fdbb285dee
commit
62b74bb88a
@@ -14,7 +14,6 @@ Help:
|
||||
Building options:
|
||||
--soc=[BCM2835|BCM2836|AM33XX|A10|A13|A20|H3]
|
||||
SoC type to be used. [configure autodetected]
|
||||
--platform-type=<TYPE> Type of platform
|
||||
--cpu-flags=<CPUFLAGS> CPU defining/optimizing flags to be used. [configure autodetected]
|
||||
--extra-cflags=<CFLAGS> Extra C flags passed to C compilation. []
|
||||
--extra-cxxflags=<CXXFLAGS> Extra C++ flags passed to C++ compilation. []
|
||||
@@ -109,7 +108,6 @@ function detect_machine {
|
||||
fi
|
||||
local soc="unknown"
|
||||
local tp="unknown"
|
||||
local rev="unknown"
|
||||
|
||||
if [ -z "$cpu" ]; then
|
||||
cpu="unknown"
|
||||
@@ -120,13 +118,12 @@ function detect_machine {
|
||||
soc="BCM2835"
|
||||
if [[ $machine == "Raspberry"* ]]; then
|
||||
tp="RPi"
|
||||
rev=($(detect_rpi_revision))
|
||||
fi
|
||||
;;
|
||||
BCM2709)
|
||||
soc="BCM2836"
|
||||
if [[ $machine == "Raspberry"* ]]; then
|
||||
rev=($(detect_rpi_revision))
|
||||
local rev=($(detect_rpi_revision))
|
||||
if [[ $rev == "a02082" || $rev == "a22082" ]]; then
|
||||
tp="RPi3"
|
||||
else
|
||||
@@ -187,7 +184,7 @@ function detect_machine {
|
||||
*)
|
||||
soc="unknown"
|
||||
esac
|
||||
echo "${soc} ${tp} ${cpu} ${rev}"
|
||||
echo "${soc} ${tp} ${cpu}"
|
||||
}
|
||||
|
||||
function gcc_cpu_flags {
|
||||
@@ -409,12 +406,7 @@ if [ -z "${SOC}" ]; then
|
||||
SOC=${info[0]}
|
||||
TYPE=${info[1]}
|
||||
CPU=${info[2]}
|
||||
REV=${info[3]}
|
||||
echo "[OK] machine detected: SoC=${SOC}, Type=${TYPE}, CPU=${CPU}, REV=${REV}."
|
||||
fi
|
||||
|
||||
if [ "${PT}" ]; then
|
||||
TYPE=${PT}
|
||||
echo "[OK] machine detected: SoC=${SOC}, Type=${TYPE}, CPU=${CPU}."
|
||||
fi
|
||||
|
||||
if [ -z "${CPUFLAGS}" ]; then
|
||||
@@ -425,10 +417,6 @@ if [[ $SOC == "BCM2835" || $SOC == "BCM2836" ]]; then
|
||||
CPPFLAGS="-DLINUX_ARCH_RASPBERRYPI $CPPFLAGS"
|
||||
fi
|
||||
|
||||
if [[ $TYPE == "RPi2" || $TYPE == "RPi3" || $REV == "0010" ]]; then
|
||||
CPPFLAGS="-D__RPI_BPLUS $CPPFLAGS"
|
||||
fi
|
||||
|
||||
if [[ ${debug} == "enable" ]]; then
|
||||
CPPFLAGS="-DMY_DEBUG $CPPFLAGS"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user