Exo: bpmpfw -> sc7fw, lp0 -> sc7

This commit is contained in:
Michael Scire 2018-12-17 11:30:59 -08:00
parent b72a68f622
commit dca51291aa
17 changed files with 23 additions and 23 deletions

View file

@ -75,14 +75,14 @@ export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(TOPDIR)/bpmpfw
$(TOPDIR)/sc7fw
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) bpmpfw.bin
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) sc7fw.bin
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
@ -109,22 +109,22 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) build_bpmpfw clean all
.PHONY: $(BUILD) build_sc7fw clean all
#---------------------------------------------------------------------------------
all: $(BUILD)
check_bpmpfw:
@$(MAKE) -C bpmpfw all
check_sc7fw:
@$(MAKE) -C sc7fw all
$(BUILD): check_bpmpfw
$(BUILD): check_sc7fw
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@$(MAKE) -C $(TOPDIR)/bpmpfw clean
@$(MAKE) -C $(TOPDIR)/sc7fw clean
@rm -fr $(BUILD) $(TARGET).bin $(TARGET).elf

View file

@ -15,7 +15,7 @@
*/
#include "utils.h"
#include "lp0.h"
#include "sc7.h"
#include "emc.h"
#include "pmc.h"
#include "timer.h"

View file

@ -15,7 +15,7 @@
*/
#include "utils.h"
#include "lp0.h"
#include "sc7.h"
#include "i2c.h"
#include "pmc.h"
#include "emc.h"
@ -55,7 +55,7 @@ static void set_pmc_dpd_io_pads(void) {
spinlock_wait(32);
}
void lp0_entry_main(void) {
void sc7_entry_main(void) {
/* Disable the BPMP Cache. */
CACHE_CTRL |= 0xC00;

View file

@ -14,12 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXOSPHERE_BPMPFW_LP0_H
#define EXOSPHERE_BPMPFW_LP0_H
#ifndef EXOSPHERE_BPMPFW_SC7_H
#define EXOSPHERE_BPMPFW_SC7_H
#include "utils.h"
void lp0_entry_main(void);
void sc7_entry_main(void);
void reboot(void);

View file

@ -25,11 +25,11 @@ _start:
.global crt0
.type crt0, %function
crt0:
@ setup to call lp0_entry_main
@ setup to call sc7_entry_main
msr cpsr_cxsf, #0xD3
ldr sp, =__stack_top__
ldr lr, =reboot
b lp0_entry_main
b sc7_entry_main
.global spinlock_wait

View file

@ -28,7 +28,7 @@
#include "flow.h"
#include "fuse.h"
#include "i2c.h"
#include "lp0.h"
#include "sc7.h"
#include "masterkey.h"
#include "pmc.h"
#include "se.h"
@ -40,7 +40,7 @@
#define u8 uint8_t
#define u32 uint32_t
#include "bpmpfw_bin.h"
#include "sc7fw_bin.h"
#undef u8
#undef u32
@ -138,11 +138,11 @@ static void setup_bpmp_sc7_firmware(void) {
/* Copy BPMP firmware. */
uint8_t *lp0_entry_code = (uint8_t *)(LP0_ENTRY_GET_RAM_SEGMENT_ADDRESS(LP0_ENTRY_RAM_SEGMENT_ID_LP0_ENTRY_CODE));
for (unsigned int i = 0; i < bpmpfw_bin_size; i += 4) {
write32le(lp0_entry_code, i, read32le(bpmpfw_bin, i));
for (unsigned int i = 0; i < sc7fw_bin_size; i += 4) {
write32le(lp0_entry_code, i, read32le(sc7fw_bin, i));
}
flush_dcache_range(lp0_entry_code, lp0_entry_code + bpmpfw_bin_size);
flush_dcache_range(lp0_entry_code, lp0_entry_code + sc7fw_bin_size);
/* Take the BPMP out of reset. */
MAKE_CAR_REG(0x304) = 2;

View file

@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EXOSPHERE_LP0_H
#define EXOSPHERE_LP0_H
#ifndef EXOSPHERE_SC7_H
#define EXOSPHERE_SC7_H
#include <stdint.h>

View file

@ -34,7 +34,7 @@
#include "se.h"
#include "userpage.h"
#include "titlekey.h"
#include "lp0.h"
#include "sc7.h"
#include "exocfg.h"
#define SMC_USER_HANDLERS 0x13