From dca51291aacfb166d7651e984e2f3f32d21c4947 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 17 Dec 2018 11:30:59 -0800 Subject: [PATCH] Exo: bpmpfw -> sc7fw, lp0 -> sc7 --- exosphere/Makefile | 14 +++++++------- exosphere/{bpmpfw => sc7fw}/Makefile | 0 exosphere/{bpmpfw => sc7fw}/linker.ld | 0 exosphere/{bpmpfw => sc7fw}/linker.specs | 0 exosphere/{bpmpfw => sc7fw}/src/emc.c | 2 +- exosphere/{bpmpfw => sc7fw}/src/emc.h | 0 exosphere/{bpmpfw => sc7fw}/src/i2c.c | 0 exosphere/{bpmpfw => sc7fw}/src/i2c.h | 0 exosphere/{bpmpfw => sc7fw}/src/pmc.h | 0 exosphere/{bpmpfw/src/lp0.c => sc7fw/src/sc7.c} | 4 ++-- exosphere/{bpmpfw/src/lp0.h => sc7fw/src/sc7.h} | 6 +++--- exosphere/{bpmpfw => sc7fw}/src/start.s | 4 ++-- exosphere/{bpmpfw => sc7fw}/src/timer.h | 0 exosphere/{bpmpfw => sc7fw}/src/utils.h | 0 exosphere/src/{lp0.c => sc7.c} | 10 +++++----- exosphere/src/{lp0.h => sc7.h} | 4 ++-- exosphere/src/smc_api.c | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) rename exosphere/{bpmpfw => sc7fw}/Makefile (100%) rename exosphere/{bpmpfw => sc7fw}/linker.ld (100%) rename exosphere/{bpmpfw => sc7fw}/linker.specs (100%) rename exosphere/{bpmpfw => sc7fw}/src/emc.c (99%) rename exosphere/{bpmpfw => sc7fw}/src/emc.h (100%) rename exosphere/{bpmpfw => sc7fw}/src/i2c.c (100%) rename exosphere/{bpmpfw => sc7fw}/src/i2c.h (100%) rename exosphere/{bpmpfw => sc7fw}/src/pmc.h (100%) rename exosphere/{bpmpfw/src/lp0.c => sc7fw/src/sc7.c} (98%) rename exosphere/{bpmpfw/src/lp0.h => sc7fw/src/sc7.h} (88%) rename exosphere/{bpmpfw => sc7fw}/src/start.s (94%) rename exosphere/{bpmpfw => sc7fw}/src/timer.h (100%) rename exosphere/{bpmpfw => sc7fw}/src/utils.h (100%) rename exosphere/src/{lp0.c => sc7.c} (97%) rename exosphere/src/{lp0.h => sc7.h} (93%) diff --git a/exosphere/Makefile b/exosphere/Makefile index 11339bb05..4eb2d4491 100644 --- a/exosphere/Makefile +++ b/exosphere/Makefile @@ -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 diff --git a/exosphere/bpmpfw/Makefile b/exosphere/sc7fw/Makefile similarity index 100% rename from exosphere/bpmpfw/Makefile rename to exosphere/sc7fw/Makefile diff --git a/exosphere/bpmpfw/linker.ld b/exosphere/sc7fw/linker.ld similarity index 100% rename from exosphere/bpmpfw/linker.ld rename to exosphere/sc7fw/linker.ld diff --git a/exosphere/bpmpfw/linker.specs b/exosphere/sc7fw/linker.specs similarity index 100% rename from exosphere/bpmpfw/linker.specs rename to exosphere/sc7fw/linker.specs diff --git a/exosphere/bpmpfw/src/emc.c b/exosphere/sc7fw/src/emc.c similarity index 99% rename from exosphere/bpmpfw/src/emc.c rename to exosphere/sc7fw/src/emc.c index e77479639..6b6e16635 100644 --- a/exosphere/bpmpfw/src/emc.c +++ b/exosphere/sc7fw/src/emc.c @@ -15,7 +15,7 @@ */ #include "utils.h" -#include "lp0.h" +#include "sc7.h" #include "emc.h" #include "pmc.h" #include "timer.h" diff --git a/exosphere/bpmpfw/src/emc.h b/exosphere/sc7fw/src/emc.h similarity index 100% rename from exosphere/bpmpfw/src/emc.h rename to exosphere/sc7fw/src/emc.h diff --git a/exosphere/bpmpfw/src/i2c.c b/exosphere/sc7fw/src/i2c.c similarity index 100% rename from exosphere/bpmpfw/src/i2c.c rename to exosphere/sc7fw/src/i2c.c diff --git a/exosphere/bpmpfw/src/i2c.h b/exosphere/sc7fw/src/i2c.h similarity index 100% rename from exosphere/bpmpfw/src/i2c.h rename to exosphere/sc7fw/src/i2c.h diff --git a/exosphere/bpmpfw/src/pmc.h b/exosphere/sc7fw/src/pmc.h similarity index 100% rename from exosphere/bpmpfw/src/pmc.h rename to exosphere/sc7fw/src/pmc.h diff --git a/exosphere/bpmpfw/src/lp0.c b/exosphere/sc7fw/src/sc7.c similarity index 98% rename from exosphere/bpmpfw/src/lp0.c rename to exosphere/sc7fw/src/sc7.c index 21de19ce6..4ae84b11c 100644 --- a/exosphere/bpmpfw/src/lp0.c +++ b/exosphere/sc7fw/src/sc7.c @@ -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; diff --git a/exosphere/bpmpfw/src/lp0.h b/exosphere/sc7fw/src/sc7.h similarity index 88% rename from exosphere/bpmpfw/src/lp0.h rename to exosphere/sc7fw/src/sc7.h index 25059490f..37f95cb33 100644 --- a/exosphere/bpmpfw/src/lp0.h +++ b/exosphere/sc7fw/src/sc7.h @@ -14,12 +14,12 @@ * along with this program. If not, see . */ -#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); diff --git a/exosphere/bpmpfw/src/start.s b/exosphere/sc7fw/src/start.s similarity index 94% rename from exosphere/bpmpfw/src/start.s rename to exosphere/sc7fw/src/start.s index a439b7d30..c648a10d4 100644 --- a/exosphere/bpmpfw/src/start.s +++ b/exosphere/sc7fw/src/start.s @@ -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 diff --git a/exosphere/bpmpfw/src/timer.h b/exosphere/sc7fw/src/timer.h similarity index 100% rename from exosphere/bpmpfw/src/timer.h rename to exosphere/sc7fw/src/timer.h diff --git a/exosphere/bpmpfw/src/utils.h b/exosphere/sc7fw/src/utils.h similarity index 100% rename from exosphere/bpmpfw/src/utils.h rename to exosphere/sc7fw/src/utils.h diff --git a/exosphere/src/lp0.c b/exosphere/src/sc7.c similarity index 97% rename from exosphere/src/lp0.c rename to exosphere/src/sc7.c index effb2dc13..f168a895f 100644 --- a/exosphere/src/lp0.c +++ b/exosphere/src/sc7.c @@ -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; diff --git a/exosphere/src/lp0.h b/exosphere/src/sc7.h similarity index 93% rename from exosphere/src/lp0.h rename to exosphere/src/sc7.h index 293789822..c5612da92 100644 --- a/exosphere/src/lp0.h +++ b/exosphere/src/sc7.h @@ -14,8 +14,8 @@ * along with this program. If not, see . */ -#ifndef EXOSPHERE_LP0_H -#define EXOSPHERE_LP0_H +#ifndef EXOSPHERE_SC7_H +#define EXOSPHERE_SC7_H #include diff --git a/exosphere/src/smc_api.c b/exosphere/src/smc_api.c index 902dd20a3..336f593cb 100644 --- a/exosphere/src/smc_api.c +++ b/exosphere/src/smc_api.c @@ -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