Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added build support for Armbian 20.x, using a 5.10.43-sunxi kernel, s… #489

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions patches/bcm43430a1/7_45_41_46/nexmon/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ brcmfmac/brcmfmac.mod.c
brcmfmac/modules.order
brcmfmac43430-sdio.bin
BUILD_NUMBER
*~
*.o
24 changes: 14 additions & 10 deletions patches/bcm43430a1/7_45_41_46/nexmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CFLAGS= \
-DUCODESIZE=$(UCODESIZE) \
-DGIT_VERSION=\"$(GIT_VERSION)\" \
-DBUILD_NUMBER=\"$$(cat BUILD_NUMBER)\" \
-Wall -Werror -O2 -nostdlib -nostartfiles -ffreestanding -mthumb -march=$(NEXMON_ARCH) \
-Wall -Werror -O2 -Wno-address-of-packed-member -nostdlib -nostartfiles -ffreestanding -mthumb -march=$(NEXMON_ARCH) \
-ffunction-sections -fdata-sections \
-I$(NEXMON_ROOT)/patches/include \
-Iinclude \
Expand All @@ -43,19 +43,23 @@ brcmfmac.ko: check-nexmon-setup-env
ifeq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifeq ($(findstring 4.14,$(shell uname -r)),4.14)
@printf "\033[0;31m BUILDING DRIVER for kernel 4.14\033[0m brcmfmac_4.14.y-nexmon/brcmfmac.ko (details: log/driver.log)\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_4.14.y-nexmon -j2 >log/driver.log
else ifeq ($(findstring 4.9,$(shell uname -r)),4.9)
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_4.14.y-nexmon >log/driver.log
else ifeq ($(findstring 4.9.,$(shell uname -r)),4.9.)
@printf "\033[0;31m BUILDING DRIVER for kernel 4.9\033[0m brcmfmac_kernel49/brcmfmac.ko (details: log/driver.log)\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel49 -j2 >log/driver.log
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel49 >log/driver.log
else ifeq ($(findstring 4.4,$(shell uname -r)),4.4)
@printf "\033[0;31m BUILDING DRIVER for kernel 4.4\033[0m brcmfmac_kernel44/brcmfmac.ko (details: log/driver.log)\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel44 -j2 >log/driver.log
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel44 >log/driver.log
else ifeq ($(findstring 5.10,$(shell uname -r)),5.10)
@printf "\033[0;31m BUILDING DRIVER for kernel 5.10\033[0m brcmfmac_kernel510/brcmfmac.ko (details: log/driver.log)\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel510 >log/driver.log
endif
else
$(warning Warning: Driver can not be compiled on this platform, execute the make command on a raspberry pi)
endif

obj/%.o: src/%.c
$(Q)mkdir -p obj gen log
@printf "\033[0;31m COMPILING\033[0m %s => %s (details: log/compiler.log)\n" $< $@
$(Q)cat gen/nexmon.pre 2>>log/error.log | gawk '{ if ($$3 != "$@") print; }' > tmp && mv tmp gen/nexmon.pre
$(Q)$(CC)gcc $(CFLAGS) -c $< -o $@ >>log/compiler.log
Expand Down Expand Up @@ -190,7 +194,7 @@ endif
@printf "\033[0;31m RELOADING\033[0m brcmfmac\n"
ifeq ($(findstring 4.14,$(shell uname -r)),4.14)
$(Q)insmod brcmfmac_4.14.y-nexmon/brcmfmac.ko
else ifeq ($(findstring 4.9,$(shell uname -r)),4.9)
else ifeq ($(findstring 4.9.,$(shell uname -r)),4.9.)
$(Q)insmod brcmfmac_kernel49/brcmfmac.ko
else ifeq ($(findstring 4.4,$(shell uname -r)),4.4)
$(Q)insmod brcmfmac_kernel44/brcmfmac.ko
Expand Down Expand Up @@ -220,13 +224,13 @@ clean: clean-firmware
ifeq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifeq ($(findstring 4.14,$(shell uname -r)),4.14)
@printf "\033[0;31m CLEANING DRIVER\033[0m\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_4.14.y-nexmon clean
else ifeq ($(findstring 4.9,$(shell uname -r)),4.9)
+$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_4.14.y-nexmon clean
else ifeq ($(findstring 4.9.,$(shell uname -r)),4.9.)
@printf "\033[0;31m CLEANING DRIVER\033[0m\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel49 clean
+$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel49 clean
else ifeq ($(findstring 4.4,$(shell uname -r)),4.4)
@printf "\033[0;31m CLEANING DRIVER\033[0m\n" $@
$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel44 clean
+$(Q)make -C /lib/modules/$(shell uname -r)/build M=$$PWD/brcmfmac_kernel44 clean
endif
endif
$(Q)rm -f BUILD_NUMBER
Expand Down
4 changes: 4 additions & 0 deletions patches/bcm43430a1/7_45_41_46/nexmon/README.sunxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
In order to be able to build the kernel module brcmfmac.ko for an up-to-date Armbian 21.05.6
(Kernel version 5.10.43-sunxi), it is necessary that kernel header and sources
have been installed using armbian-config.

64 changes: 64 additions & 0 deletions patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac_kernel510/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# Makefile fragment for Broadcom 802.11n Networking Device Driver
#
# Copyright (c) 2010 Broadcom Corporation
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# -I$(NEXMON_ROOT)/patches/bcm43455c0/7_45_189/nexmon/brcmfmac_5.4.y-nexmon \
# -I$(NEXMON_ROOT)/patches/bcm43455c0/7_45_189/nexmon/brcmfmac_5.4.y-nexmon/include \

ccflags-y += \
-Idrivers/net/wireless/brcm80211/brcmfmac \
-I$(NEXMON_ROOT)/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac_kernel510 \
-I$(NEXMON_ROOT)/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac_kernel510/include
# -DDEBUG

CONFIG_BRCMDBG=y
#CONFIG_BRCMDBG
#subdir-ccflags-$(CONFIG_BRCMDBG) += -DDEBUG
#subdir-ccflags-y += -DDEBUG

obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += \
cfg80211.o \
chip.o \
fwil.o \
fweh.o \
p2p.o \
proto.o \
common.o \
core.o \
firmware.o \
feature.o \
btcoex.o \
vendor.o \
pno.o
# debug.o
brcmfmac-$(CONFIG_BRCMFMAC_PROTO_BCDC) += \
bcdc.o \
fwsignal.o
brcmfmac-$(CONFIG_BRCMFMAC_PROTO_MSGBUF) += \
commonring.o \
flowring.o \
msgbuf.o
brcmfmac-$(CONFIG_BRCMFMAC_SDIO) += \
sdio.o \
bcmsdh.o
brcmfmac-$(CONFIG_BRCMFMAC_USB) += \
usb.o
brcmfmac-$(CONFIG_BRCMFMAC_PCIE) += \
pcie.o
brcmfmac-$(CONFIG_BRCM_TRACING) += \
tracepoint.o
brcmfmac-$(CONFIG_OF) += \
of.o
Empty file.
Loading