Skip to content

Commit

Permalink
ipq60xx: add new target
Browse files Browse the repository at this point in the history
  • Loading branch information
aiamadeus committed Mar 18, 2022
1 parent 97eae6b commit 1ecbe70
Show file tree
Hide file tree
Showing 21 changed files with 1,320 additions and 8 deletions.
22 changes: 22 additions & 0 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,28 @@ config KERNEL_ENCRYPTED_KEYS
depends on KERNEL_KEYS
default n

config KERNEL_ARCH_IPQ256M
bool "Compile kernel for 256M profile"
default n
help
Compile kernel for 256M profile, this option enables kernel
to add 8MB of DDR to kernel lowmem in 256M profile.

config KERNEL_IPQ_MEM_PROFILE
int "Different memory profile "
range 256 1024
default 512
depends on TARGET_ipq60xx
help
This option select memory profile to be used,which defines
the reserved memory configuration used in device tree.

config KERNEL_SKB_FIXED_SIZE_2K
bool "SKB size fixed at 2K"
default n
help
SKB size fixed at 2K.

#
# CGROUP support symbols
#
Expand Down
4 changes: 2 additions & 2 deletions include/quilt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ ifneq ($(CONFIG_TARGET_ipq60xx),y)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_PATCH_DIR),generic/)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_HACK_DIR),generic-hack/)
$(call PatchDir,$(LINUX_DIR),$(PATCH_DIR),platform/)
endif
$(call PatchDir,$(LINUX_DIR),$(PATCH_DIR),platform/)
endef

define Quilt/RefreshDir
Expand Down Expand Up @@ -136,8 +136,8 @@ ifneq ($(CONFIG_TARGET_ipq60xx),y)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_HACK_DIR),generic-hack/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
endif
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
endef

define Quilt/Template
Expand Down
2 changes: 1 addition & 1 deletion include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
include $(INCLUDE_DIR)/kernel-version.mk
endif

GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
ifeq ($(CONFIG_TARGET_ipq60xx),y)
GENERIC_BACKPORT_DIR :=
GENERIC_PATCH_DIR :=
GENERIC_HACK_DIR :=
GENERIC_FILES_DIR :=
else
GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
Expand Down
39 changes: 39 additions & 0 deletions package/boot/uboot-envtools/files/ipq60xx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

[ -e /etc/config/ubootenv ] && exit 0

touch /etc/config/ubootenv

. /lib/uboot-envtools.sh
. /lib/functions.sh

board=$(board_name)

ubootenv_mtdinfo () {
UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})

if [ -n "$nor_flash" ]; then
ubootenv_size=$mtd_size
else
# size is fixed to 0x40000 in u-boot
ubootenv_size=0x40000
fi

sectors=$(( $ubootenv_size / $mtd_erase ))
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}

case "$board" in
*)
ubootenv_add_uci_config $(ubootenv_mtdinfo)
;;
esac

config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv

exit 0
28 changes: 28 additions & 0 deletions package/kernel/linux/modules/crypto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ endef
$(eval $(call KernelPackage,crypto-aead))


define KernelPackage/crypto-aes
TITLE:=AES cipher CryptoAPI module
KCONFIG:=CONFIG_CRYPTO_AES
FILES:=$(LINUX_DIR)/crypto/aes_generic.ko
AUTOLOAD:=$(call AutoLoad,09,aes_generic)
$(call AddDepends/crypto)
endef

$(eval $(call KernelPackage,crypto-aes))


define KernelPackage/crypto-authenc
TITLE:=Combined mode wrapper for IPsec
DEPENDS:=+kmod-crypto-manager +kmod-crypto-null
Expand Down Expand Up @@ -581,6 +592,23 @@ endef
$(eval $(call KernelPackage,crypto-pcompress))


define KernelPackage/crypto-qcrypto
TITLE:=QTI crypto CE engine
KCONFIG:= \
CONFIG_CRYPTO_DEV_QCRYPTO \
CONFIG_CRYPTO_DEV_QCEDEV
FILES:= \
$(LINUX_DIR)/drivers/crypto/msm/qcrypto.ko \
$(LINUX_DIR)/drivers/crypto/msm/qcedev.ko
AUTOLOAD:=$(call AutoLoad,09,qcrypto)
DEPENDS:=+kmod-crypto-aes +kmod-crypto-des \
+kmod-crypto-hash +kmod-crypto-manager
$(call AddDepends/crypto)
endef

$(eval $(call KernelPackage,crypto-qcrypto))


define KernelPackage/crypto-rsa
TITLE:=RSA algorithm
DEPENDS:=+kmod-crypto-manager +kmod-asn1-decoder
Expand Down
50 changes: 49 additions & 1 deletion package/kernel/linux/modules/netdevices.mk
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,39 @@ endef

$(eval $(call KernelPackage,mdio-gpio))

define KernelPackage/aq_phy
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Aquantia PHY Driver
DEPENDS:=@TARGET_ipq806x
KCONFIG:=CONFIG_AQ_PHY
FILES:= \
$(LINUX_DIR)/drivers/net/phy/[email protected] \
$(LINUX_DIR)/drivers/net/phy/qca_85xx/[email protected]
AUTOLOAD:=$(call AutoLoad,10,aq_phy)
endef

define KernelPackage/aq_phy/description
Aquantia PHY Driver
endef

$(eval $(call KernelPackage,aq_phy))

define KernelPackage/qca_85xx_sw
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=QCA 85xx Switch Driver
DEPENDS:=@TARGET_ipq806x
KCONFIG:=CONFIG_QCA_85XX_SWITCH
FILES:= \
$(LINUX_DIR)/drivers/net/phy/[email protected] \
$(LINUX_DIR)/drivers/net/phy/qca_85xx/[email protected]
AUTOLOAD:=$(call AutoLoad,40,qca_85xx_sw)
endef

define KernelPackage/qca_85xx_sw/description
QCA 85xx Switch Driver
endef

$(eval $(call KernelPackage,qca_85xx_sw))

define KernelPackage/et131x
SUBMENU:=$(NETWORK_DEVICES_MENU)
Expand Down Expand Up @@ -202,7 +235,7 @@ define KernelPackage/swconfig
DEPENDS:=+kmod-libphy
KCONFIG:=CONFIG_SWCONFIG
FILES:=$(LINUX_DIR)/drivers/net/phy/swconfig.ko
AUTOLOAD:=$(call AutoLoad,41,swconfig)
AUTOLOAD:=$(call AutoLoad,29,swconfig)
endef

define KernelPackage/swconfig/description
Expand All @@ -211,6 +244,21 @@ endef

$(eval $(call KernelPackage,swconfig))

define KernelPackage/switch-ar40xx
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Qualcomm Atheros AR40XX switch support
DEPENDS:=@TARGET_ipq40xx +kmod-swconfig
KCONFIG:=CONFIG_AR40XX_PHY
FILES:=$(LINUX_DIR)/drivers/net/phy/ar40xx.ko
AUTOLOAD:=$(call AutoLoad,30,ar40xx)
endef

define KernelPackage/switch-ar40xx/description
Qualcomm atheros AR40XX switch support
endef

$(eval $(call KernelPackage,switch-ar40xx))

define KernelPackage/switch-mvsw61xx
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Marvell 88E61xx switch support
Expand Down
15 changes: 15 additions & 0 deletions package/kernel/linux/modules/netsupport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ endef

$(eval $(call KernelPackage,misdn))

define KernelPackage/nsh
SUBMENU:=$(NETWORK_SUPPORT_MENU)
TITLE:=Network Service Header (NSH) protocol
DEPENDS:=
KCONFIG:=CONFIG_NET_NSH
FILES:=$(LINUX_DIR)/net/nsh/nsh.ko
AUTOLOAD:=$(call AutoLoad,13,nsh)
endef

define KernelPackage/nsh/description
Network Service Header is an implementation of Service Function
Chaining (RFC 7665). Requires kernel 4.14 or newer
endef

$(eval $(call KernelPackage,nsh))

define KernelPackage/isdn4linux
SUBMENU:=$(NETWORK_SUPPORT_MENU)
Expand Down
10 changes: 6 additions & 4 deletions package/kernel/linux/modules/usb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ $(eval $(call KernelPackage,usb-dwc3))

define KernelPackage/usb-dwc3-of-simple
TITLE:=DWC3 USB simple OF driver
DEPENDS:=@!LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
KCONFIG:= CONFIG_USB_DWC3_OF_SIMPLE
FILES:= \
$(LINUX_DIR)/drivers/usb/dwc3/dwc3-of-simple.ko \
Expand All @@ -500,10 +500,12 @@ $(eval $(call KernelPackage,usb-dwc3-of-simple))

define KernelPackage/usb-dwc3-qcom
TITLE:=DWC3 Qualcomm USB driver
DEPENDS:=@LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
KCONFIG:= CONFIG_USB_DWC3_QCOM
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1)
FILES:= \
$(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko \
$(LINUX_DIR)/drivers/usb/dwc3/dbm.ko
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom dbm,1)
$(call AddDepends/usb)
endef

Expand Down
15 changes: 15 additions & 0 deletions target/linux/generic/config-4.4
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ CONFIG_ARCH_FLATMEM_ENABLE=y
# CONFIG_ARCH_ZYNQ is not set
# CONFIG_ARCNET is not set
# CONFIG_ARC_EMAC is not set
# CONFIG_ARM64_ERRATUM_819472 is not set
# CONFIG_ARM64_ERRATUM_824069 is not set
# CONFIG_ARM64_ERRATUM_826319 is not set
# CONFIG_ARM64_ERRATUM_827319 is not set
# CONFIG_ARM64_ERRATUM_832075 is not set
# CONFIG_ARM64_ERRATUM_834220 is not set
# CONFIG_ARM64_ERRATUM_843419 is not set
# CONFIG_ARM64_ERRATUM_845719 is not set
# CONFIG_ARM_APPENDED_DTB is not set
# CONFIG_ARM_ARCH_TIMER is not set
# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set
Expand Down Expand Up @@ -752,9 +760,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
# CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set
# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set
# CONFIG_CRYPTO_DEV_MV_CESA is not set
# CONFIG_CRYPTO_DEV_OTA_CRYPTO is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set
# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set
# CONFIG_CRYPTO_DEV_QCE is not set
# CONFIG_CRYPTO_DEV_QCOM_MSM_QCE is not set
# CONFIG_CRYPTO_DEV_QCRYPTO is not set
# CONFIG_CRYPTO_DEV_SAHARA is not set
# CONFIG_CRYPTO_DEV_TALITOS is not set
# CONFIG_CRYPTO_DRBG_CTR is not set
Expand Down Expand Up @@ -1150,6 +1161,7 @@ CONFIG_FRAME_WARN=1024
# CONFIG_FRONTSWAP is not set
# CONFIG_FSCACHE is not set
# CONFIG_FSL_EDMA is not set
# CONFIG_FSL_MC_BUS is not set
# CONFIG_FSL_PQ_MDIO is not set
# CONFIG_FSL_XGMAC_MDIO is not set
CONFIG_FSNOTIFY=y
Expand Down Expand Up @@ -1378,6 +1390,7 @@ CONFIG_HW_PERF_EVENTS=y
# CONFIG_HW_RANDOM_PPC4XX is not set
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
# CONFIG_HW_RANDOM_VIA is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
# CONFIG_HYPERV is not set
# CONFIG_HYSDN is not set
CONFIG_HZ=100
Expand Down Expand Up @@ -1988,6 +2001,7 @@ CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
# CONFIG_MAILBOX is not set
# CONFIG_MANGLE_BOOTARGS is not set
# CONFIG_MAP_E_SUPPORT is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_MAX1027 is not set
# CONFIG_MAX1363 is not set
Expand Down Expand Up @@ -2493,6 +2507,7 @@ CONFIG_NET_CORE=y
# CONFIG_NET_DSA is not set
# CONFIG_NET_DSA_BCM_SF2 is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MV88E6063 is not set
# CONFIG_NET_DSA_MV88E6123_61_65 is not set
# CONFIG_NET_DSA_MV88E6131 is not set
# CONFIG_NET_DSA_MV88E6171 is not set
Expand Down
23 changes: 23 additions & 0 deletions target/linux/ipq60xx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include $(TOPDIR)/rules.mk

ARCH:=aarch64
BOARD:=ipq60xx
BOARDNAME:=Qualcomm Atheros IPQ60xx
FEATURES:=squashfs fpu ramdisk nand
MAINTAINER:=John Crispin <[email protected]>
CPU_TYPE:=cortex-a53
SUBTARGETS:=generic

KERNEL_PATCHVER:=4.4

KERNELNAME:=Image dtbs

include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += \
kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
kmod-qca-nss-dp kmod-qca-nss-drv kmod-qca-ssdk \
kmod-ath11k-ahb qca-ssdk-shell wpad-openssl \
ath11k-firmware-ipq6018 nss-firmware-ipq6018 \
kmod-qca-nss-drv-pppoe uboot-envtools

$(eval $(call BuildTarget))
20 changes: 20 additions & 0 deletions target/linux/ipq60xx/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
#
# Copyright (C) 2015 OpenWrt.org
#

. /lib/functions/uci-defaults.sh

board_config_update

board=$(board_name)
boardname="${board##*,}"

case "$board" in
*)
;;
esac

board_config_flush

exit 0
26 changes: 26 additions & 0 deletions target/linux/ipq60xx/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#

. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh

ipq60xx_setup_interfaces()
{
local board="$1"

case "$board" in
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}

board_config_update
board=$(board_name)
ipq60xx_setup_interfaces $board
board_config_flush

exit 0
Loading

0 comments on commit 1ecbe70

Please sign in to comment.