Skip to content
Permalink
Browse files

bcm4366c0: adding firmware files for 10.10.122.20 (dhd.ko taken from …

…RT-AC86U firmware version 3.0.0.4.384.81049)
  • Loading branch information...
jlinktu committed Oct 24, 2019
1 parent 0e3d0da commit 867dc302c2d76f548a4b32d07f4e2bcdf2d06c85
@@ -0,0 +1,31 @@
include definitions.mk

all: $(RAM_FILE) muucode.bin muucodex.bin nonmuucode.bin nonmuucodex.bin flashpatches.c

$(RAM_FILE): dhd.ko
dd bs=1 if=$< of=$@ skip=$$((0x04e798)) count=$$((0x10f4cf)) status=none

muucode.bin: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING UCODE\033[0m\n"
$(Q)dd if=$< of=$@ bs=1 skip=$$(($(MUUCODESTART)-$(RAMSTART))) count=$$(($(MUUCODESIZE))) 2>/dev/null

muucodex.bin: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING UCODE\033[0m\n"
$(Q)dd if=$< of=$@ bs=1 skip=$$(($(MUUCODEXSTART)-$(RAMSTART))) count=$$(($(MUUCODEXSIZE))) 2>/dev/null

nonmuucode.bin: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING UCODE\033[0m\n"
$(Q)dd if=$< of=$@ bs=1 skip=$$(($(NONMUUCODESTART)-$(RAMSTART))) count=$$(($(NONMUUCODESIZE))) 2>/dev/null

nonmuucodex.bin: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING UCODE\033[0m\n"
$(Q)dd if=$< of=$@ bs=1 skip=$$(($(NONMUUCODEXSTART)-$(RAMSTART))) count=$$(($(NONMUUCODEXSIZE))) 2>/dev/null

flashpatches.c: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING FLASHPATCHES\033[0m\n"
$(Q)printf "#include <patcher.h>\n\n" > flashpatches.c
$(Q)$(NEXMON_ROOT)/buildtools/flash_patch_extractor/fpext -y -r $< -s $(RAMSTART) -b $(FP_CONFIG_ORIGBASE) -e $(FP_CONFIG_ORIGEND) >> $@

clean:
@printf "\033[0;31m CLEANING\033[0m\n"
$(Q)rm -f *ucodex.bin *ucode.bin templateram.bin flashpatches.c $(RAM_FILE)
@@ -0,0 +1,70 @@
NEXMON_CHIP=CHIP_VER_BCM4366c0
NEXMON_CHIP_NUM=`$(NEXMON_ROOT)/buildtools/scripts/getdefine.sh $(NEXMON_CHIP)`
NEXMON_FW_VERSION=FW_VER_10_10_122_20
NEXMON_FW_VERSION_NUM=`$(NEXMON_ROOT)/buildtools/scripts/getdefine.sh $(NEXMON_FW_VERSION)`
RXE_RXHDR_LEN=62
RXE_RXHDR_EXTRA=0

NEXMON_ARCH=armv7-r

RAM_FILE=dlarray_4366c0.bin
RAMSTART=0x200000
# needs to be defined
RAMSIZE=0x240000

ROM_FILE=rom.bin
ROMSTART=0x0
ROMSIZE=0xc8400

HNDRTE_RECLAIM_UCODES_END=0x2C7394
HNDRTE_RECLAIM_UCODES_END_PTR=0x20CB6C

PATCHSIZE=0x4000
PATCHSTART=$$(($(HNDRTE_RECLAIM_UCODES_END) - $(PATCHSIZE)))

# original ucode start and size
NONMUUCODESTART = 0x2ACB64
NONMUUCODESIZE = 0xAA58
NONMUUCODESTART_PTR = 0x244A9C
NONMUUCODESIZE_PTR = 0x244A98
WLC_NONMUUCODE_WRITE_BL_HOOK_ADDR=0x244A2A

NONMUUCODEXSTART = 0x2B75BC
NONMUUCODEXSIZE = 0x2640
NONMUUCODEXSTART_PTR = 0x244AA0
NONMUUCODEXSIZE_PTR = 0x244AA4
WLC_NONMUUCODEX_WRITE_BL_HOOK_ADDR=0x244A36

MUUCODESTART = 0x2B9C04
MUUCODESIZE = 0xAF40
MUUCODESTART_PTR = 0x244AC0
MUUCODESIZE_PTR = 0x244ABC
WLC_MUUCODE_WRITE_BL_HOOK_ADDR=0x244A6E

MUUCODEXSTART = 0x2C4B4C
MUUCODEXSIZE = 0x2848
MUUCODEXSTART_PTR = 0x244AC4
MUUCODEXSIZE_PTR = 0x244AC8
# same as WLC_NONMUUCODEX_WRITE_BL_HOOK_ADDR as function only called once
WLC_MUUCODEX_WRITE_BL_HOOK_ADDR=0x244A36

# original template ram start and size
# needs to be defined
TEMPLATERAMSTART=0
TEMPLATERAMSIZE=0

FP_DATA_END_PTR=0x2E5024
# fp_check_success
FP_CONFIG_BASE_PTR_1=0x2E358C
FP_CONFIG_END_PTR_1=0x2E3590
# fp_apply_patches
FP_CONFIG_BASE_PTR_2=0x2E36B4
FP_CONFIG_END_PTR_2=0x2E36B0
FP_CONFIG_SIZE=0x2000
FP_CONFIG_BASE=$$(($(PATCHSTART) - $(FP_CONFIG_SIZE)))

FP_DATA_BASE=0x202000
FP_CONFIG_ORIGBASE=0x204000
FP_CONFIG_ORIGEND=0x204800

VERSION_PTR=0x2EF594
Binary file not shown.
@@ -0,0 +1,52 @@
/***************************************************************************
* *
* ########### ########### ########## ########## *
* ############ ############ ############ ############ *
* ## ## ## ## ## ## ## *
* ## ## ## ## ## ## ## *
* ########### #### ###### ## ## ## ## ###### *
* ########### #### # ## ## ## ## # # *
* ## ## ###### ## ## ## ## # # *
* ## ## # ## ## ## ## # # *
* ############ ##### ###### ## ## ## ##### ###### *
* ########### ########### ## ## ## ########## *
* *
* S E C U R E M O B I L E N E T W O R K I N G *
* *
* This file is part of NexMon. *
* *
* Copyright (c) 2016 NexMon Team *
* *
* NexMon is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* NexMon is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with NexMon. If not, see <http://www.gnu.org/licenses/>. *
* *
**************************************************************************/

#ifndef STRUCTS_H
#define STRUCTS_H

/* band types */
#define WLC_BAND_AUTO 0 /* auto-select */
#define WLC_BAND_5G 1 /* 5 Ghz */
#define WLC_BAND_2G 2 /* 2.4 Ghz */
#define WLC_BAND_ALL 3 /* all bands */

#ifndef PAD
#define _PADLINE(line) pad ## line
#define _XSTR(line) _PADLINE(line)
#define PAD _XSTR(__LINE__)
#endif

#include "../structs.common.h"

#endif /*STRUCTS_H */
@@ -0,0 +1,11 @@
SUBDIRS = $(dir $(wildcard */definitions.mk))

all: $(SUBDIRS)

$(SUBDIRS): FORCE
ifndef (,$(wildcard $(addprefix $@, Makefile)))
@printf "\033[0;31m EXECUTING MAKE FOR FIRMWARE VERSION\033[0m %s\n" $@
$(Q)make -C $@
endif

FORCE:

0 comments on commit 867dc30

Please sign in to comment.
You can’t perform that action at this time.