Skip to content

Commit

Permalink
bcm4375b1: added firmware 18.41.113 STA (FWID=01-8e8956a6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlinktu committed Aug 5, 2023
1 parent 58bdc1b commit 64e95f9
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 0 deletions.
41 changes: 41 additions & 0 deletions firmwares/bcm4375b1/18_41_113_sta/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
include definitions.mk

all: ucode1.bin ucode2.bin templateram0.bin templateram1.bin templateram2.bin flashpatches.c

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

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

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

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

templateram2.bin: $(RAM_FILE) definitions.mk
@printf "\033[0;31m EXTRACTING TEMPLATERAM 2\033[0m\n"
$(Q)dd if=$< of=$@ bs=1 skip=$$(($(TEMPLATERAMSTART2)-$(RAMSTART))) count=$$(($(TEMPLATERAMSIZE2))) 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 -x -r $< -s $(RAMSTART) -b $(FP_CONFIG_ORIGBASE) -e $(FP_CONFIG_ORIGEND) >> $@

rom.bin: ../rom.bin
@printf "\033[0;31m APPLYING FLASHPATCHES TO CLEAN ROM\033[0m\n"
$(Q)$(NEXMON_ROOT)/buildtools/flash_patch_extractor/fpext -y -r $(RAM_FILE) -s $(RAMSTART) -b $(FP_CONFIG_ORIGBASE) -e $(FP_CONFIG_ORIGEND) -i $< -o $@ -t $(ROMSTART) > /dev/null

complete.bin: $(RAM_FILE) rom.bin
@printf "\033[0;31m MERGING %s and rom.bin into %s\033[0m\n" $< $@
$(Q)dd if=rom.bin of=$@ bs=1 seek=$$(($(ROMSTART))) conv=notrunc 2>/dev/null
$(Q)dd if=$< of=$@ bs=1 seek=$$(($(RAMSTART))) conv=notrunc 2>/dev/null

clean:
@printf "\033[0;31m CLEANING\033[0m\n"
$(Q)rm -f ucode1.bin ucode2.bin templateram0.bin templateram1.bin templateram2.bin flashpatches.c rom.bin
Binary file not shown.
63 changes: 63 additions & 0 deletions firmwares/bcm4375b1/18_41_113_sta/definitions.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
NEXMON_CHIP=CHIP_VER_BCM4375b1
NEXMON_CHIP_NUM=`$(NEXMON_ROOT)/buildtools/scripts/getdefine.sh $(NEXMON_CHIP)`
NEXMON_FW_VERSION=FW_VER_18_41_113_sta
NEXMON_FW_VERSION_NUM=`$(NEXMON_ROOT)/buildtools/scripts/getdefine.sh $(NEXMON_FW_VERSION)`

NEXMON_ARCH=armv7-r

RAM_FILE=bcmdhd_sta.bin_b1
RAMSTART=0x170000
RAMSIZE=0x2a0000

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

WLC_UCODE_WRITE_BL_HOOK_ADDR=0x271042
HNDRTE_RECLAIM_0_END_PTR=0x1D4210
HNDRTE_RECLAIM_0_END=0x2AB5A4
TEMPLATERAMSTART_PTR=0x0

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

# original ucode start and size
UCODE1START=0x289C10
UCODE1SIZE=0xFC30
UCODE1START_PTR=0x271088
UCODE1SIZE_PTR=0x271084

UCODE2START=0x299844
UCODE2SIZE=0xD750
UCODE2START_PTR=0x271080
UCODE2SIZE_PTR=0x27107C

# original template ram start and size
TEMPLATERAMSTART0_PTR=0x289A50
TEMPLATERAMSTART0=0x2A6F98
TEMPLATERAMSIZE0=0x148C
TEMPLATERAMSTART1_PTR=0x289A54
TEMPLATERAMSTART1=0x2A9370
TEMPLATERAMSIZE1=0x2234
TEMPLATERAMSTART2_PTR=0x289A58
TEMPLATERAMSTART2=0x2A8424
TEMPLATERAMSIZE2=0xF4C

# original vasip start and size
VASIPSTART_PTR=0x0
VASIPSTART=0x0
VASIPSIZE=0x0

FP_CONFIG_ORIGBASE=0x2AB5A4
FP_CONFIG_ORIGEND=0x2AC5A4
FP_CONFIG_BASE_PTR_1=0x257DEC
FP_CONFIG_END_PTR_1=0x257DF0
FP_CONFIG_BASE_PTR_2=0x257F7C
FP_CONFIG_END_PTR_2=0x257F80
#FP_CONFIG_BASE_PTR_3=0x257EB8
#FP_CONFIG_END_PTR_3=0x257EBC
#FP_CONFIG_BASE_PTR_4=0x26A308
#FP_CONFIG_END_PTR_4=0x26A30C
FP_CONFIG_SIZE=0x1000
FP_CONFIG_BASE=$$(($(PATCHSTART) - $(FP_CONFIG_SIZE)))
FP_DATA_BASE=0x180000
52 changes: 52 additions & 0 deletions firmwares/bcm4375b1/18_41_113_sta/structs.h
Original file line number Diff line number Diff line change
@@ -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 */
1 change: 1 addition & 0 deletions patches/include/firmware_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
#define FW_VER_18_38_18_mfg 514
#define FW_VER_18_40_42_sta 515
#define FW_VER_18_41_8_9_sta 516
#define FW_VER_18_41_113_sta 517

// for CHIP_VER_BCM43436b0
#define FW_VER_9_88_4_65 710
Expand Down

0 comments on commit 64e95f9

Please sign in to comment.