Skip to content
Permalink
Browse files

BCM4375: Added bcm4375 firmware version 18.38.18.

  • Loading branch information
matthiasseemoo committed Dec 25, 2019
1 parent c401108 commit ef565316b7b013c4e6812a3034db58defe6c7adf
@@ -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.
@@ -0,0 +1,64 @@
NEXMON_CHIP=CHIP_VER_BCM4375b1
NEXMON_CHIP_NUM=`$(NEXMON_ROOT)/buildtools/scripts/getdefine.sh $(NEXMON_CHIP)`
NEXMON_FW_VERSION=FW_VER_18_38_18_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
# needs to be defined
RAMSIZE=0x2a0000

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

WLC_UCODE_WRITE_BL_HOOK_ADDR = 0x24dfde
HNDRTE_RECLAIM_0_END_PTR = 0x1c4b84
HNDRTE_RECLAIM_0_END = 0x28a32c
TEMPLATERAMSTART_PTR = 0x0

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

# original ucode start and size
# original ucode start and size
UCODE1START = 0x266548
UCODE1SIZE = 0xFBE8
UCODE1START_PTR = 0x24e024
UCODE1SIZE_PTR = 0x24e020

UCODE2START = 0x276134
UCODE2SIZE = 0xFBE8
UCODE2START_PTR = 0x24e01c
UCODE2SIZE_PTR = 0x24e018

# original template ram start and size
TEMPLATERAMSTART0_PTR=0x266388
TEMPLATERAMSTART0=0x285d20
TEMPLATERAMSIZE0=0x148c
TEMPLATERAMSTART1_PTR=0x26638c
TEMPLATERAMSTART1=0x2880f8
TEMPLATERAMSIZE1=0x2234
TEMPLATERAMSTART2_PTR=0x266390
TEMPLATERAMSTART2=0x2871ac
TEMPLATERAMSIZE2=0xf4c

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

#needs to be defined
FP_DATA_END_PTR=0x20B6D0

FP_CONFIG_BASE_PTR_1 = 0x234e90
FP_CONFIG_END_PTR_1 = 0x234e94
FP_CONFIG_BASE_PTR_2 = 0x235020
FP_CONFIG_END_PTR_2 = 0x235024
FP_CONFIG_SIZE=0x1000
FP_CONFIG_BASE=$$(($(PATCHSTART) - $(FP_CONFIG_SIZE)))
FP_DATA_BASE=0x180000
FP_CONFIG_ORIGBASE=0x28A32C
FP_CONFIG_ORIGEND=0x28B2B4
@@ -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 comments on commit ef56531

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