summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-02-14 05:16:27 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-02-25 01:06:24 +0100
commit81c178b82dd8bdef3df37c3a3dcd20c1956da308 (patch)
treea01b684a7fbd3614d52260ad94975fe52673b9b0
parentdfadc720caa6e6031a69b1e6f19ffb36d327ae45 (diff)
add support for raspberry pi4 32 bit
-rw-r--r--package/bcm28xx-bootloader/Makefile8
-rw-r--r--package/bcm28xx-vc/Makefile2
-rwxr-xr-xscripts/install.sh18
-rw-r--r--target/arm/kernel/raspberry-pi4 (renamed from target/arm/kernel/raspberry-pi3p)0
-rw-r--r--target/arm/systems/raspberry-pi4 (renamed from target/arm/systems/raspberry-pi3p)8
-rw-r--r--target/config/Config.in.cpu10
-rw-r--r--target/config/Config.in.runtime20
-rw-r--r--target/linux/Config.in.kernelcfg3
-rw-r--r--target/linux/patches/59aeb16c7f1254f1383476956dda0766d10c918a/disable-gcc-plugins.patch22
9 files changed, 67 insertions, 24 deletions
diff --git a/package/bcm28xx-bootloader/Makefile b/package/bcm28xx-bootloader/Makefile
index 9b9d65477..a74935714 100644
--- a/package/bcm28xx-bootloader/Makefile
+++ b/package/bcm28xx-bootloader/Makefile
@@ -12,7 +12,7 @@ PKG_SECTION:= base/boot
PKG_URL:= https://github.com/raspberrypi/firmware
PKG_SITES:= https://github.com/raspberrypi/firmware.git
-PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64
+PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi4 raspberry-pi3p-64
PKG_CHOICES_BCM28XX_BOOTLOADER:= DEFAULT EXTRA CUTDOWN
PKGCD_DEFAULT:= default bootloader
@@ -42,10 +42,16 @@ do-install:
printf "dtparam=audio,i2s,spi,i2c\n" >> \
$(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_DEFAULT),y)
+ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI4)$(ADK_TARGET_SYSTEM_RASPBERRY_PI4_64),y)
+ $(CP) $(WRKBUILD)/boot/{start4.elf,fixup4.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
+ printf "start_file=start4.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
+ printf "fixup_file=fixup4.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
+else
$(CP) $(WRKBUILD)/boot/{start.elf,fixup.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
printf "start_file=start.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
printf "fixup_file=fixup.dat\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
endif
+endif
ifeq ($(ADK_PACKAGE_BCM28XX_BOOTLOADER_EXTRA),y)
$(CP) $(WRKBUILD)/boot/{start_x.elf,fixup_x.dat} $(IDIR_BCM28XX_BOOTLOADER)/boot/
printf "start_file=start_x.elf\n" >> $(IDIR_BCM28XX_BOOTLOADER)/boot/config.txt
diff --git a/package/bcm28xx-vc/Makefile b/package/bcm28xx-vc/Makefile
index a523a0bec..07225cc24 100644
--- a/package/bcm28xx-vc/Makefile
+++ b/package/bcm28xx-vc/Makefile
@@ -26,7 +26,7 @@ PKGSC_BCM28XX_VC_GL_LIBS:=libs/video
PKGSS_BCM28XX_VC_GL_LIBS:=bcm28xx-vc-libs
PKGSD_BCM28XX_VC_GL_LIBS:=videocore gl library
-PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64
+PKG_SYSTEM_DEPENDS:= raspberry-pi raspberry-pi0 raspberry-pi2 raspberry-pi3 raspberry-pi3-64 raspberry-pi4 raspberry-pi3p-64
include $(ADK_TOPDIR)/mk/package.mk
diff --git a/scripts/install.sh b/scripts/install.sh
index 9f0debac9..cd03fdb38 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -155,7 +155,7 @@ tgt=$2
src=$3
case $target {
-(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi3p|raspberry-pi3p-64|solidrun-imx6|solidrun-clearfog|default) ;;
+(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi3p-64|solidrun-imx6|solidrun-clearfog|default) ;;
(*)
print -u2 "Unknown target '$target', exiting"
exit 1 ;;
@@ -178,7 +178,7 @@ case $ostype {
basedev=$tgt
rootpart=${basedev}s1
datapart=${basedev}s2
- if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi3p || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
+ if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
bootpart=${basedev}s1
rootpart=${basedev}s2
datapart=${basedev}s3
@@ -229,7 +229,7 @@ case $ostype {
rootpart=${basedev}${partitionsep}1
datapart=${basedev}${partitionsep}2
- if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi3p || $target = raspberry-pi3p-64 ]]; then
+ if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi3p-64 ]]; then
bootpart=${basedev}${partitionsep}1
rootpart=${basedev}${partitionsep}2
datapart=${basedev}${partitionsep}3
@@ -294,7 +294,7 @@ syspartno=0
# data - flexible (parameter)
# system - everything else
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi3p || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
syspartno=1
bootfssz=100
if (( grub )); then
@@ -351,7 +351,7 @@ fi
#(( partofs = ((coreendsec / secs) + 1) * secs ))
# we just use 2048 all the time, since some loaders are longer
partofs=2048
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi3p || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
(( spartofs = partofs + (100 * 2048) ))
else
spartofs=$partofs
@@ -462,7 +462,7 @@ if (( datafssz )); then
dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) 2>/dev/null
fi
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi3p || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi3p-64 || $target = phytec-wega ]]; then
# move system and data partition from #0/#1 to #1/#2
dd if="$T/firsttrack" bs=1 skip=$((0x1BE)) count=32 of="$T/x" 2>/dev/null
dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) if="$T/x" 2>/dev/null
@@ -555,7 +555,7 @@ case $target {
dd if="$fwdir/SPL" of="$tgt" bs=1024 seek=1 > /dev/null 2>&1
dd if="$fwdir/u-boot.img" of="$tgt" bs=1024 seek=69 > /dev/null 2>&1
;;
-(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi3p|raspberry-pi3p-64)
+(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi3p-64)
(( noformat )) || create_fs "$bootpart" ADKBOOT vfat
;;
(phytec-wega)
@@ -575,7 +575,7 @@ if (( datafssz )); then
((keep)) || create_fs "$datapart" ADKDATA ext4
((keep)) || tune_fs "$datapart"
case $target {
- (raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi3p|raspberry-pi3p-64|phytec-wega)
+ (raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi3p-64|phytec-wega)
echo "/dev/mmcblk0p3 /data ext4 rw 0 0" >> "$R"/etc/fstab
;;
(banana-pro|orange-pi0|solidrun-clearfog)
@@ -597,7 +597,7 @@ fi
(( quiet )) || print Finishing up with bootloader and kernel ...
case $target {
-(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi3p|raspberry-pi3p-64)
+(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi3p-64)
mount_fs "$bootpart" "$B" vfat
for x in "$R"/boot/*; do
[[ -e "$x" ]] && mv -f "$R"/boot/* "$B/"
diff --git a/target/arm/kernel/raspberry-pi3p b/target/arm/kernel/raspberry-pi4
index 7928b3968..7928b3968 100644
--- a/target/arm/kernel/raspberry-pi3p
+++ b/target/arm/kernel/raspberry-pi4
diff --git a/target/arm/systems/raspberry-pi3p b/target/arm/systems/raspberry-pi4
index d2100a948..6f36bf036 100644
--- a/target/arm/systems/raspberry-pi3p
+++ b/target/arm/systems/raspberry-pi4
@@ -1,8 +1,8 @@
-config ADK_TARGET_SYSTEM_RASPBERRY_PI3P
- bool "Raspberry PI 3 Model B+"
+config ADK_TARGET_SYSTEM_RASPBERRY_PI4
+ bool "Raspberry PI 4"
depends on ADK_TARGET_OS_LINUX
select ADK_TARGET_LITTLE_ENDIAN
- select ADK_TARGET_CPU_ARM_CORTEX_A53
+ select ADK_TARGET_CPU_ARM_CORTEX_A72
select ADK_TARGET_BOARD_BCM28XX
select ADK_TARGET_WITH_VGA
select ADK_TARGET_WITH_SERIAL
@@ -23,5 +23,5 @@ config ADK_TARGET_SYSTEM_RASPBERRY_PI3P
select ADK_TARGET_WITH_ROOT_RW
select ADK_TARGET_KERNEL_IMAGE
help
- Raspberry PI 3 Model B+
+ Raspberry PI 4
diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu
index 30e35ca93..3762ddf82 100644
--- a/target/config/Config.in.cpu
+++ b/target/config/Config.in.cpu
@@ -178,6 +178,16 @@ config ADK_TARGET_CPU_ARM_CORTEX_A57
select ADK_TARGET_CPU_WITH_THUMB2
depends on ADK_TARGET_ARCH_ARM
+config ADK_TARGET_CPU_ARM_CORTEX_A72
+ bool "cortex-a72"
+ select ADK_TARGET_SUPPORTS_THREADS
+ select ADK_TARGET_SUPPORTS_NPTL
+ select ADK_TARGET_SUPPORTS_LT
+ select ADK_TARGET_CPU_WITH_FPU_VFPV4
+ select ADK_TARGET_CPU_WITH_NEON
+ select ADK_TARGET_CPU_WITH_THUMB2
+ depends on ADK_TARGET_ARCH_ARM
+
config ADK_TARGET_CPU_ARM_CORTEX_M7
bool "cortex-m7"
select ADK_TARGET_SUPPORTS_NPTL
diff --git a/target/config/Config.in.runtime b/target/config/Config.in.runtime
index 8a3e482a8..6d17102b8 100644
--- a/target/config/Config.in.runtime
+++ b/target/config/Config.in.runtime
@@ -169,7 +169,9 @@ config ADK_RUNTIME_TMPFS_SIZE
default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI
default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI3
- default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
+ default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI4
+ default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
+ default "32768" if ADK_TARGET_SYSTEM_RASPBERRY_PI4_64
default "32768" if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default "16384" if ADK_TARGET_SYSTEM_QEMU_X86_64
default "16384" if ADK_TARGET_SYSTEM_QEMU_X86
@@ -293,9 +295,9 @@ config ADK_RUNTIME_GETTY_VGA
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI0
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
- default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
+ default y if ADK_TARGET_SYSTEM_RASPBERRY_PI4
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
- default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64
+ default y if ADK_TARGET_SYSTEM_RASPBERRY_PI4_64
default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG
default y if ADK_TARGET_SYSTEM_ARANYM_M68K
@@ -315,7 +317,9 @@ config ADK_RUNTIME_GETTY_SERIAL
default n if ADK_TARGET_SYSTEM_RASPBERRY_PI
default n if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default n if ADK_TARGET_SYSTEM_RASPBERRY_PI3
- default n if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
+ default n if ADK_TARGET_SYSTEM_RASPBERRY_PI4
+ default n if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
+ default n if ADK_TARGET_SYSTEM_RASPBERRY_PI4_64
default n if ADK_TARGET_SYSTEM_LEMOTE_YEELONG
default n if ADK_TARGET_SYSTEM_ARANYM_M68K
default n if ADK_TARGET_MODEL_PCENGINES_ALIX1C
@@ -356,9 +360,9 @@ config ADK_RUNTIME_CONSOLE_SERIAL_DEVICE
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI3
- default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
+ default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI4
default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
- default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64
+ default "ttyAMA0" if ADK_TARGET_SYSTEM_RASPBERRY_PI4_64
default "ttyDA1" if ADK_TARGET_SYSTEM_QEMU_METAG
default "ttyS2" if ADK_TARGET_SYSTEM_KINETIS_K70
default "ttyS2" if ADK_TARGET_SYSTEM_SOM_C6745
@@ -507,8 +511,8 @@ config ADK_RUNTIME_WAIT_FOR_ETHERNET
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
- default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
- default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64
+ default y if ADK_TARGET_SYSTEM_RASPBERRY_PI4
+ default y if ADK_TARGET_SYSTEM_RASPBERRY_PI4_64
config ADK_SIMPLE_NETWORK_CONFIG
bool "simple network configuration"
diff --git a/target/linux/Config.in.kernelcfg b/target/linux/Config.in.kernelcfg
index bd6f65b57..e1feb5e0e 100644
--- a/target/linux/Config.in.kernelcfg
+++ b/target/linux/Config.in.kernelcfg
@@ -7,6 +7,7 @@ depends on ADK_TARGET_OS_LINUX
default ADK_TARGET_LINUX_KERNEL_USE_DEFCONFIG if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK && ADK_TARGET_LINUX_KERNEL_VERSION_GIT
default ADK_TARGET_LINUX_KERNEL_USE_DEFCONFIG if ADK_TARGET_SYSTEM_PHYTEC_WEGA && ADK_TARGET_LINUX_KERNEL_VERSION_GIT
default ADK_TARGET_LINUX_KERNEL_USE_DEFCONFIG if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG && ADK_TARGET_LINUX_KERNEL_VERSION_GIT
+default ADK_TARGET_LINUX_KERNEL_USE_DEFCONFIG if ADK_TARGET_BOARD_BCM28XX && ADK_TARGET_LINUX_KERNEL_VERSION_GIT
config ADK_TARGET_LINUX_KERNEL_USE_MINICONFIG
bool "Use mini.config from OpenADK"
@@ -26,7 +27,7 @@ config ADK_TARGET_LINUX_KERNEL_DEFCONFIG
default "bcmrpi_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI0
default "bcm2709_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI2
default "bcm2709_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI3
- default "bcm2709_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI3P
+ default "bcm2711_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI4
default "bcmrpi3_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI3_64
default "bcmrpi3_defconfig" if ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64
default "twr-k70f120m_defconfig" if ADK_TARGET_SYSTEM_KINETIS_K70
diff --git a/target/linux/patches/59aeb16c7f1254f1383476956dda0766d10c918a/disable-gcc-plugins.patch b/target/linux/patches/59aeb16c7f1254f1383476956dda0766d10c918a/disable-gcc-plugins.patch
new file mode 100644
index 000000000..271fc5402
--- /dev/null
+++ b/target/linux/patches/59aeb16c7f1254f1383476956dda0766d10c918a/disable-gcc-plugins.patch
@@ -0,0 +1,22 @@
+diff -Nur linux-59aeb16c7f1254f1383476956dda0766d10c918a.orig/arch/arm/Kconfig linux-59aeb16c7f1254f1383476956dda0766d10c918a/arch/arm/Kconfig
+--- linux-59aeb16c7f1254f1383476956dda0766d10c918a.orig/arch/arm/Kconfig 2022-01-21 19:27:36.000000000 +0100
++++ linux-59aeb16c7f1254f1383476956dda0766d10c918a/arch/arm/Kconfig 2022-02-13 02:06:15.880669581 +0100
+@@ -88,7 +88,6 @@
+ select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
+ select HAVE_FUNCTION_TRACER if !XIP_KERNEL
+ select HAVE_FUTEX_CMPXCHG if FUTEX
+- select HAVE_GCC_PLUGINS
+ select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)
+ select HAVE_IDE if PCI || ISA || PCMCIA
+ select HAVE_IRQ_TIME_ACCOUNTING
+diff -Nur linux-59aeb16c7f1254f1383476956dda0766d10c918a.orig/arch/arm64/Kconfig linux-59aeb16c7f1254f1383476956dda0766d10c918a/arch/arm64/Kconfig
+--- linux-59aeb16c7f1254f1383476956dda0766d10c918a.orig/arch/arm64/Kconfig 2022-01-21 19:27:37.000000000 +0100
++++ linux-59aeb16c7f1254f1383476956dda0766d10c918a/arch/arm64/Kconfig 2022-02-13 02:06:27.852961034 +0100
+@@ -165,7 +165,6 @@
+ select HAVE_FUNCTION_TRACER
+ select HAVE_FUNCTION_ERROR_INJECTION
+ select HAVE_FUNCTION_GRAPH_TRACER
+- select HAVE_GCC_PLUGINS
+ select HAVE_HW_BREAKPOINT if PERF_EVENTS
+ select HAVE_IRQ_TIME_ACCOUNTING
+ select HAVE_NMI