Browse Source

add basic raspberry pi3 support (ARM 32Bit)

Waldemar Brodkorb 8 years ago
parent
commit
dfd6417b8a

+ 1 - 1
package/bcm28xx-bootloader/Makefile

@@ -11,7 +11,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-pi2
+PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 raspberry-pi3
 
 PKG_CHOICES_BCM28XX_BOOTLOADER:=	DEFAULT EXTRA CUTDOWN
 PKGCD_DEFAULT:=		default bootloader

+ 1 - 1
package/bcm28xx-vc/Makefile

@@ -23,7 +23,7 @@ PKGSC_BCM28XX_VC_DEBUG:=libs/misc
 PKGSD_BCM28XX_VC_DEBUG:=videocore debug library
 PKGSC_BCM28XX_VC_GL_LIBS:=libs/video
 
-PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2
+PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 raspberry-pi3
 
 include $(ADK_TOPDIR)/mk/package.mk
 

+ 1 - 1
package/kodi/Makefile

@@ -69,7 +69,7 @@ PKGFS_WITH_LIRC:=	lirc
 PKGFD_WITH_WEBSERVER:=	enable internal webserver support
 
 PKG_BUILDDEP_SOLIDRUN_IMX6:=	gpu-viv-bin-mx6q
-PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 solidrun-imx6
+PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 raspberry-pi3 solidrun-imx6
 
 DIFF_IGNOREFILES:=	configure missing depcomp install-sh INSTALL \
 			aclocal.m4 config.h.in

+ 1 - 1
package/omxplayer/Makefile

@@ -16,7 +16,7 @@ PKG_NEEDS:=		threads rt c++
 PKG_URL:=		https://github.com/popcornmix/omxplayer
 PKG_SITES:=		https://github.com/popcornmix/omxplayer.git
 
-PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2
+PKG_SYSTEM_DEPENDS:=	raspberry-pi raspberry-pi2 raspberry-pi3
 
 include $(ADK_TOPDIR)/mk/package.mk
 

+ 9 - 9
scripts/install.sh

@@ -144,7 +144,7 @@ tgt=$2
 src=$3
 
 case $target {
-(banana-pro|pcengines-apu|raspberry-pi|raspberry-pi2|solidrun-imx6|default) ;;
+(banana-pro|pcengines-apu|raspberry-pi|raspberry-pi2|raspberry-pi3|solidrun-imx6|default) ;;
 (*)
 	print -u2 "Unknown target '$target', exiting"
 	exit 1 ;;
@@ -167,7 +167,7 @@ case $ostype {
 	basedev=$tgt
 	rootpart=${basedev}s1
 	datapart=${basedev}s2
-	if [[ $target = raspberry-pi || $target = raspberry-pi2 ]]; then
+	if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 ]]; then
 		bootpart=${basedev}s1
 		rootpart=${basedev}s2
 		datapart=${basedev}s3
@@ -194,7 +194,7 @@ case $ostype {
 	basedev=$tgt
 	rootpart=${basedev}1
 	datapart=${basedev}2
-	if [[ $target = raspberry-pi || $target = raspberry-pi2 ]]; then
+	if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 ]]; then
 		bootpart=${basedev}1
 		rootpart=${basedev}2
 		datapart=${basedev}3
@@ -257,7 +257,7 @@ syspartno=0
 # data - flexible (parameter)
 # system - everything else
 
-if [[ $target = raspberry-pi || $target = raspberry-pi2 ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 ]]; then
 	syspartno=1
 	bootfssz=100
 	if (( grub )); then
@@ -314,7 +314,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-pi2 ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 ]]; then
 	(( spartofs = partofs + (100 * 2048) ))
 else
 	spartofs=$partofs
@@ -425,7 +425,7 @@ if (( datafssz )); then
 	    dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) 2>/dev/null
 fi
 
-if [[ $target = raspberry-pi || $target = raspberry-pi2 ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 ]]; 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
@@ -512,7 +512,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=42 > /dev/null 2>&1
 	;;
-(raspberry-pi|raspberry-pi2)
+(raspberry-pi|raspberry-pi2|raspberry-pi3)
 	(( noformat )) || create_fs "$bootpart" ADKBOOT vfat
 	;;
 }
@@ -529,7 +529,7 @@ if (( datafssz )); then
 	((keep)) || create_fs "$datapart" ADKDATA ext4
 	((keep)) || tune_fs "$datapart"
 	case $target {
-	(raspberry-pi|raspberry-pi2)
+	(raspberry-pi|raspberry-pi2|raspberry-pi3)
 		echo "/dev/mmcblk0p3	/data	ext4	rw	0	0" >> "$R"/etc/fstab 
 	;;
 	(banana-pro|solidrun-imx6)
@@ -539,7 +539,7 @@ if (( datafssz )); then
 fi
 
 case $target {
-(raspberry-pi|raspberry-pi2)
+(raspberry-pi|raspberry-pi2|raspberry-pi3)
 	mount_fs "$bootpart" "$B" vfat
 	for x in "$R"/boot/*; do
 		[[ -e "$x" ]] && mv -f "$R"/boot/* "$B/"

+ 4 - 30
target/arm/Makefile

@@ -50,30 +50,16 @@ ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERS
 	@echo "Start qemu with following options:"
 	@echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
 endif
-ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
+ifeq ($(ADK_TARGET_BOARD_BCM28XX)$(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
 ifeq ($(ADK_APPLIANCE_KODI),y)
 	@echo "Use following command to install with a writable data partition"
-	@echo "sudo ./scripts/install.sh -d 256 raspberry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
+	@echo "sudo ./scripts/install.sh -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
 	@echo "If you want to update a card without loosing existing data on the writable partition use:"
-	@echo "sudo ./scripts/install.sh -k -d 256 raspbrry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
+	@echo "sudo ./scripts/install.sh -k -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
 	@echo "In both cases the cfgfs partition is _not_ removed!"
 else
 	@echo "Use following command to install it on SD card:"
-	@echo "sudo ./scripts/install.sh raspberry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-endif
-endif
-ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
-ifeq ($(ADK_APPLIANCE_KODI),y)
-	@echo "Use following command to install with a writable data partition"
-	@echo "sudo ./scripts/install.sh -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-	@echo "If you want to update a card without loosing existing data on the writable partition use:"
-	@echo "sudo ./scripts/install.sh -k -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-	@echo "In both cases the cfgfs partition is _not_ removed!"
-else
-	@echo "Use following command to install it on SD card:"
-	@echo "sudo ./scripts/install.sh raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-	@echo "Use following command to install with a writable data partition"
-	@echo "sudo ./scripts/install.sh -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
+	@echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
 endif
 endif
 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
@@ -82,18 +68,6 @@ ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y)
 	@echo "Use following command to install with a writable data partition"
 	@echo "sudo ./scripts/install.sh -d 256 banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
 endif
-ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
-ifeq ($(ADK_APPLIANCE_KODI),y)
-	@echo "Use following command to install with a writable data partition"
-	@echo "sudo ./scripts/install.sh -d 256 solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-	@echo "If you want to update a card without loosing existing data on the writable partition use:"
-	@echo "sudo ./scripts/install.sh -k -d 256 solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-	@echo "In both cases the cfgfs partition is _not_ removed!"
-else
-	@echo "Use following command to install it on SD card:"
-	@echo "sudo ./scripts/install.sh solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
-endif
-endif
 endif
 ifeq ($(ADK_TARGET_FS),initramfs)
 targethelp:

+ 18 - 0
target/arm/kernel/raspberry-pi3

@@ -0,0 +1,18 @@
+CONFIG_ARM=y
+CONFIG_ARCH_BCM2709=y
+CONFIG_BCM2709_DT=y
+CONFIG_PHYS_OFFSET=0
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_FIQ=y
+CONFIG_ATAGS=y
+CONFIG_KUSER_HELPERS=y
+CONFIG_ARM_ERRATA_643719=y
+CONFIG_BCM2708_NOL2CACHE=y
+CONFIG_RASPBERRYPI_FIRMWARE=y
+CONFIG_BRCM_CHAR_DRIVERS=y
+CONFIG_BCM2708_VCHIQ=y
+CONFIG_BCM2708_VCMEM=y
+CONFIG_MAILBOX=y
+CONFIG_BCM2835_MBOX=y
+CONFIG_OF=y
+CONFIG_CMDLINE_FROM_BOOTLOADER=y

+ 25 - 0
target/arm/systems/raspberry-pi3

@@ -0,0 +1,25 @@
+config ADK_TARGET_SYSTEM_RASPBERRY_PI3
+	bool "Raspberry PI 3"
+	depends on ADK_TARGET_LITTLE_ENDIAN
+	select ADK_TARGET_CPU_ARM_CORTEX_A53
+	select ADK_TARGET_BOARD_BCM28XX
+	select ADK_TARGET_WITH_VGA
+	select ADK_TARGET_WITH_SERIAL
+	select ADK_TARGET_WITH_CPU_FREQ
+	select ADK_TARGET_WITH_USB
+	select ADK_TARGET_WITH_INPUT
+	select ADK_TARGET_WITH_SD
+	select ADK_TARGET_WITH_I2C
+	select ADK_TARGET_WITH_SPI
+	select ADK_TARGET_WITH_SMP
+	select ADK_TARGET_WITH_NET
+	select ADK_TARGET_WITH_NETDEVICE
+	select ADK_TARGET_WITH_BLOCK
+	select ADK_TARGET_WITH_SOUND
+	select ADK_PACKAGE_BCM28XX_BOOTLOADER
+	select ADK_TARGET_WITH_ROOT_RW
+	select ADK_TARGET_KERNEL_ZIMAGE
+	select ADK_TARGET_KERNEL_WITH_COMPRESSION
+	help
+	  Raspberry PI 3
+

+ 20 - 0
target/config/Config.in.cpu

@@ -111,6 +111,22 @@ config ADK_TARGET_CPU_ARM_CORTEX_A17
 	select ADK_TARGET_CPU_WITH_NEON
 	depends on ADK_TARGET_ARCH_ARM
 
+config ADK_TARGET_CPU_ARM_CORTEX_A53
+        bool "cortex-a53"
+	select ADK_TARGET_WITH_NPTL
+	select ADK_TARGET_WITH_MMU
+	select ADK_TARGET_CPU_WITH_FPU_VFPV4
+	select ADK_TARGET_CPU_WITH_NEON
+	depends on ADK_TARGET_ARCH_ARM
+
+config ADK_TARGET_CPU_ARM_CORTEX_A57
+        bool "cortex-a57"
+	select ADK_TARGET_WITH_NPTL
+	select ADK_TARGET_WITH_MMU
+	select ADK_TARGET_CPU_WITH_FPU_VFPV4
+	select ADK_TARGET_CPU_WITH_NEON
+	depends on ADK_TARGET_ARCH_ARM
+
 config ADK_TARGET_CPU_ARM_CORTEX_M4
 	bool "cortex-m4"
 	select ADK_TARGET_UCLINUX
@@ -1393,6 +1409,8 @@ config ADK_TARGET_GCC_CPU
 	default "cortex-a9" if ADK_TARGET_CPU_ARM_CORTEX_A9
 	default "cortex-a15" if ADK_TARGET_CPU_ARM_CORTEX_A15
 	default "cortex-a17" if ADK_TARGET_CPU_ARM_CORTEX_A17
+	default "cortex-a53" if ADK_TARGET_CPU_ARM_CORTEX_A53
+	default "cortex-a57" if ADK_TARGET_CPU_ARM_CORTEX_A57
 	default "cortex-a53" if ADK_TARGET_CPU_AARCH64_CORTEX_A53
 	default "cortex-a57" if ADK_TARGET_CPU_AARCH64_CORTEX_A57
 	default "cortex-m3" if ADK_TARGET_CPU_ARM_CORTEX_M3
@@ -1573,6 +1591,8 @@ config ADK_TARGET_CPU_TYPE
 	default "arm1176jzf_s" if ADK_TARGET_CPU_ARM_ARM1176JZF_S
 	default "arm926ej_s" if ADK_TARGET_CPU_ARM_ARM926EJ_S
 	default "mpcore" if ADK_TARGET_CPU_ARM_ARM11MPCORE
+	default "cortex_a53" if ADK_TARGET_CPU_ARM_CORTEX_A53
+	default "cortex_a57" if ADK_TARGET_CPU_ARM_CORTEX_A57
 	default "cortex_a53" if ADK_TARGET_CPU_AARCH64_CORTEX_A53
 	default "cortex_a57" if ADK_TARGET_CPU_AARCH64_CORTEX_A57
 	default "mips32" if ADK_TARGET_CPU_MIPS_MIPS32

+ 5 - 1
target/config/Config.in.runtime

@@ -109,6 +109,7 @@ config ADK_RUNTIME_TMPFS_SIZE
 	default "32768" if ADK_TARGET_SYSTEM_IBM_X40
 	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_SOLIDRUN_IMX6
 	default "8192" if ADK_TARGET_SYSTEM_MIKROTIK_RB532
 	default "1024"
@@ -212,6 +213,7 @@ config ADK_RUNTIME_GETTY_VGA
 	default y if ADK_TARGET_QEMU_WITH_GRAPHIC
 	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI
 	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
 	default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
 	default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG
 	default y if ADK_TARGET_SYSTEM_IBM_X40
@@ -230,6 +232,7 @@ config ADK_RUNTIME_GETTY_SERIAL
 	default n if ADK_TARGET_QEMU_WITH_GRAPHIC
 	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_LEMOTE_YEELONG
 	default n if ADK_TARGET_SYSTEM_IBM_X40
 	default n if ADK_TARGET_SYSTEM_ARANYM_M68K
@@ -390,10 +393,11 @@ config ADK_BINSH_ZSH
 
 endchoice
 
-# workaround for USB ethernet f.e. Raspberry Pi2
+# workaround for USB ethernet f.e. Raspberry Pi 2/3
 config ADK_RUNTIME_WAIT_FOR_ETHERNET
 	bool
 	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
 
 config ADK_SIMPLE_NETWORK_CONFIG
 	bool "simple network configuration"

+ 1 - 1
target/linux/config/Config.in.audio

@@ -179,7 +179,7 @@ config ADK_KERNEL_SND_PXA2XX_SOC_SPITZ
 	default n
 
 config ADK_KERNEL_SND_BCM2835
-	tristate "BCM2835 onboard soundcard"
+	tristate "BCM28XX onboard soundcard"
 	select ADK_KERNEL_SND
 	select ADK_KERNEL_SND_ARM
 	depends on ADK_TARGET_BOARD_BCM28XX

+ 1 - 1
target/linux/config/Config.in.cpu

@@ -55,7 +55,7 @@ config ADK_KERNEL_ARM_IMX6Q_CPUFREQ
 	default n
 
 config ADK_KERNEL_ARM_BCM2835_CPUFREQ
-	bool "CPU frequency support for BCM2835 boards"
+	bool "CPU frequency support for BCM28XX boards"
 	select ADK_KERNEL_CPU_FREQ
 	depends on ADK_TARGET_BOARD_BCM28XX
 	default y if ADK_TARGET_BOARD_BCM28XX

+ 2 - 2
target/linux/config/Config.in.graphics

@@ -242,7 +242,7 @@ config ADK_KERNEL_FB_SM7XX
 	  Framebuffer support for Lemote Yeelong.
 
 config ADK_KERNEL_FB_BCM2708
-	bool "Framebuffer support for BCM2835 boards"
+	bool "Framebuffer support for BCM28XX boards"
 	select ADK_KERNEL_DRM if ADK_TARGET_KERNEL_VERSION_4_4
 	select ADK_KERNEL_DRM_VC4 if ADK_TARGET_KERNEL_VERSION_4_4
 	select ADK_KERNEL_FB
@@ -252,7 +252,7 @@ config ADK_KERNEL_FB_BCM2708
  	default n
 	depends on ADK_TARGET_BOARD_BCM28XX
  	help
-	  Framebuffer support for BCM2835 boards.
+	  Framebuffer support for BCM28XX boards.
 
 config ADK_KERNEL_FB_RADEON
 	bool "Framebuffer support for RADEON chips"

+ 2 - 2
target/linux/config/Config.in.i2c

@@ -11,7 +11,7 @@ config ADK_KERNEL_I2C_CHARDEV
  	tristate
 
 config ADK_KERNEL_I2C_BCM2708
-	tristate "I2C driver for BCM2835 boards"
+	tristate "I2C driver for BCM28XX boards"
 	select ADK_KERNEL_I2C
 	select ADK_KERNEL_REGMAP
 	select ADK_KERNEL_REGMAP_I2C
@@ -20,7 +20,7 @@ config ADK_KERNEL_I2C_BCM2708
 	default y if ADK_TARGET_BOARD_BCM28XX
 	default n
 	help
-	  I2C driver for BCM2835 boards.
+	  I2C driver for BCM28XX boards.
 
 config ADK_KERNEL_I2C_SUNXI
 	tristate "I2C driver for SUNXI boards"

+ 1 - 0
target/linux/config/Config.in.kernel

@@ -317,6 +317,7 @@ config ADK_KERNEL_HIGHMEM
 	bool "Enable high memory"
 	default y if ADK_TARGET_SYSTEM_IBM_X40
 	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI2
+	default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
 	default y if ADK_TARGET_MODEL_CUBOX_I4PRO
 	default y if ADK_TARGET_MODEL_CUBOX_I2ULTRA
 	default y if ADK_TARGET_MODEL_CUBOX_I2EX

+ 1 - 1
target/linux/config/Config.in.spi

@@ -27,7 +27,7 @@ config ADK_KERNEL_SPI_PXA2XX
 	select ADK_KERNEL_SPI
 
 config ADK_KERNEL_SPI_BCM2835
-	tristate "SPI driver for BCM2835 boards"
+	tristate "SPI driver for BCM28XX boards"
 	select ADK_KERNEL_SPI
 	select ADK_KERNEL_SPI_MASTER
 	select ADK_KERNEL_SPI_BITBANG

+ 2 - 2
target/linux/config/Config.in.watchdog

@@ -16,13 +16,13 @@ config ADK_KERNEL_CS5535_CLOCK_EVENT_SRC
 	bool
 
 config ADK_KERNEL_BCM2708_WDT
-	bool "Hardware Watchdog for BCM2835 boards"
+	bool "Hardware Watchdog for BCM28XX boards"
 	select ADK_KERNEL_WATCHDOG
 	depends on ADK_TARGET_BOARD_BCM28XX
 	default y if ADK_TARGET_BOARD_BCM28XX
 	default n
 	help
-	  Watchdog driver for BCM2835 boards.
+	  Watchdog driver for BCM28XX boards.
 
 config ADK_KERNEL_IMX2_WDT
 	bool "Hardware Watchdog for IMX6 boards"