mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-18 08:22:04 +00:00
Fix bpmpfw/Makefile, other changes.
This commit is contained in:
parent
90f792b1cc
commit
91d1b047c4
5 changed files with 63 additions and 67 deletions
|
@ -12,24 +12,23 @@ dir_source := src
|
||||||
dir_build := build
|
dir_build := build
|
||||||
dir_out := out
|
dir_out := out
|
||||||
|
|
||||||
ASFLAGS :=
|
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
|
||||||
|
|
||||||
|
ASFLAGS := -g $(ARCH)
|
||||||
|
|
||||||
CFLAGS = \
|
CFLAGS = \
|
||||||
-Iinclude \
|
$(ARCH) \
|
||||||
-Iinclude/compat \
|
-g \
|
||||||
-march=armv8-a \
|
-O2 \
|
||||||
-mlittle-endian \
|
-ffunction-sections \
|
||||||
-fno-stack-protector \
|
-fdata-sections \
|
||||||
-fno-common \
|
-fomit-frame-pointer \
|
||||||
-fno-builtin \
|
|
||||||
-fno-inline \
|
-fno-inline \
|
||||||
-ffreestanding \
|
-std=gnu11 \
|
||||||
-std=gnu99 \
|
|
||||||
-Werror \
|
-Werror \
|
||||||
-Wall \
|
-Wall
|
||||||
-Wno-error=unused-variable
|
|
||||||
|
|
||||||
LDFLAGS := -nostartfiles -Wl,--nmagic
|
LDFLAGS = -g $(ARCH) -nostartfiles -nostdlib -Wl,--nmagic,--gc-sections
|
||||||
|
|
||||||
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
|
||||||
$(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
|
$(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
|
||||||
|
@ -59,4 +58,4 @@ $(dir_build)/%.o: $(dir_source)/%.c
|
||||||
|
|
||||||
$(dir_build)/%.o: $(dir_source)/%.s
|
$(dir_build)/%.o: $(dir_source)/%.s
|
||||||
@mkdir -p "$(@D)"
|
@mkdir -p "$(@D)"
|
||||||
$(COMPILE.s) $(OUTPUT_OPTION) $<
|
$(COMPILE.c) -x assembler-with-cpp $(OUTPUT_OPTION) $<
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "pmc.h"
|
#include "pmc.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
void emc_trigger_timing_update(void) {
|
static void emc_trigger_timing_update(void) {
|
||||||
EMC_TIMING_CONTROL_0 = 1;
|
EMC_TIMING_CONTROL_0 = 1;
|
||||||
while (EMC_EMC_STATUS_0 & 0x800000) {
|
while (EMC_EMC_STATUS_0 & 0x800000) {
|
||||||
/* Wait until TIMING_UPDATE_STALLED is unset. */
|
/* Wait until TIMING_UPDATE_STALLED is unset. */
|
||||||
|
|
|
@ -33,7 +33,7 @@ void i2c_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read the BUS_CLEAR_STATUS. Result doesn't matter. */
|
/* Read the BUS_CLEAR_STATUS. Result doesn't matter. */
|
||||||
uint32_t unused_clear_status = I2C_I2C_BUS_CLEAR_STATUS_0;
|
I2C_I2C_BUS_CLEAR_STATUS_0;
|
||||||
|
|
||||||
/* Read and set the Interrupt Status. */
|
/* Read and set the Interrupt Status. */
|
||||||
uint32_t int_status = I2C_INTERRUPT_STATUS_REGISTER_0;
|
uint32_t int_status = I2C_INTERRUPT_STATUS_REGISTER_0;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "lp0.h"
|
#include "lp0.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
@ -18,13 +19,13 @@
|
||||||
void reboot(void) {
|
void reboot(void) {
|
||||||
/* Write MAIN_RST */
|
/* Write MAIN_RST */
|
||||||
APBDEV_PMC_CNTRL_0 = 0x10;
|
APBDEV_PMC_CNTRL_0 = 0x10;
|
||||||
while (1) {
|
while (true) {
|
||||||
/* Wait for reboot. */
|
/* Wait for reboot. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void set_pmc_dpd_io_pads(void) {
|
static void set_pmc_dpd_io_pads(void) {
|
||||||
/* Read val from EMC_PMC scratch, configure accordingly. */
|
/* Read val from EMC_PMC scratch, configure accordingly. */
|
||||||
uint32_t emc_pmc_val = EMC_PMC_SCRATCH3_0;
|
uint32_t emc_pmc_val = EMC_PMC_SCRATCH3_0;
|
||||||
APBDEV_PMC_DDR_CNTRL_0 = emc_pmc_val & 0x7FFFF;
|
APBDEV_PMC_DDR_CNTRL_0 = emc_pmc_val & 0x7FFFF;
|
||||||
|
@ -99,7 +100,7 @@ void lp0_entry_main(void) {
|
||||||
/* Enter deep sleep. */
|
/* Enter deep sleep. */
|
||||||
APBDEV_PMC_DPD_ENABLE_0 |= 1;
|
APBDEV_PMC_DPD_ENABLE_0 |= 1;
|
||||||
|
|
||||||
while (1) { /* Wait until we're asleep. */ }
|
while (true) { /* Wait until we're asleep. */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,15 @@ _start:
|
||||||
.type crt0, %function
|
.type crt0, %function
|
||||||
crt0:
|
crt0:
|
||||||
@ setup to call lp0_entry_main
|
@ setup to call lp0_entry_main
|
||||||
msr cpsr_f, #0xC0
|
msr cpsr_cxsf, #0xD3
|
||||||
msr cpsr_cf, #0xD3
|
|
||||||
ldr sp, =__stack_top__
|
ldr sp, =__stack_top__
|
||||||
ldr lr, =reboot
|
ldr lr, =reboot
|
||||||
bl lp0_entry_main
|
b lp0_entry_main
|
||||||
infloop:
|
|
||||||
b infloop
|
|
||||||
|
|
||||||
|
|
||||||
.global spinlock_wait
|
.global spinlock_wait
|
||||||
.type spinlock_wait, %function
|
.type spinlock_wait, %function
|
||||||
spinlock_wait:
|
spinlock_wait:
|
||||||
sub r0, r0, #1
|
subs r0, r0, #1
|
||||||
cmp r0, #0
|
|
||||||
bgt spinlock_wait
|
bgt spinlock_wait
|
||||||
bx lr
|
bx lr
|
Loading…
Reference in a new issue