1
0
Fork 0
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:
TuxSH 2018-02-23 13:56:23 +01:00
parent 90f792b1cc
commit 91d1b047c4
5 changed files with 63 additions and 67 deletions

View file

@ -12,24 +12,23 @@ dir_source := src
dir_build := build
dir_out := out
ASFLAGS :=
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
ASFLAGS := -g $(ARCH)
CFLAGS = \
-Iinclude \
-Iinclude/compat \
-march=armv8-a \
-mlittle-endian \
-fno-stack-protector \
-fno-common \
-fno-builtin \
-fno-inline \
-ffreestanding \
-std=gnu99 \
$(ARCH) \
-g \
-O2 \
-ffunction-sections \
-fdata-sections \
-fomit-frame-pointer \
-fno-inline \
-std=gnu11 \
-Werror \
-Wall \
-Wno-error=unused-variable
-Wall
LDFLAGS := -nostartfiles -Wl,--nmagic
LDFLAGS = -g $(ARCH) -nostartfiles -nostdlib -Wl,--nmagic,--gc-sections
objects = $(patsubst $(dir_source)/%.s, $(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
@mkdir -p "$(@D)"
$(COMPILE.s) $(OUTPUT_OPTION) $<
$(COMPILE.c) -x assembler-with-cpp $(OUTPUT_OPTION) $<

View file

@ -5,7 +5,7 @@
#include "pmc.h"
#include "timer.h"
void emc_trigger_timing_update(void) {
static void emc_trigger_timing_update(void) {
EMC_TIMING_CONTROL_0 = 1;
while (EMC_EMC_STATUS_0 & 0x800000) {
/* Wait until TIMING_UPDATE_STALLED is unset. */

View file

@ -33,7 +33,7 @@ void i2c_init(void) {
}
/* 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. */
uint32_t int_status = I2C_INTERRUPT_STATUS_REGISTER_0;

View file

@ -1,4 +1,5 @@
#include <stdint.h>
#include <stdbool.h>
#include "lp0.h"
#include "i2c.h"
@ -18,13 +19,13 @@
void reboot(void) {
/* Write MAIN_RST */
APBDEV_PMC_CNTRL_0 = 0x10;
while (1) {
while (true) {
/* 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. */
uint32_t emc_pmc_val = EMC_PMC_SCRATCH3_0;
APBDEV_PMC_DDR_CNTRL_0 = emc_pmc_val & 0x7FFFF;
@ -99,7 +100,7 @@ void lp0_entry_main(void) {
/* Enter deep sleep. */
APBDEV_PMC_DPD_ENABLE_0 |= 1;
while (1) { /* Wait until we're asleep. */ }
while (true) { /* Wait until we're asleep. */ }
}

View file

@ -10,19 +10,15 @@ _start:
.type crt0, %function
crt0:
@ setup to call lp0_entry_main
msr cpsr_f, #0xC0
msr cpsr_cf, #0xD3
msr cpsr_cxsf, #0xD3
ldr sp, =__stack_top__
ldr lr, =reboot
bl lp0_entry_main
infloop:
b infloop
b lp0_entry_main
.global spinlock_wait
.type spinlock_wait, %function
spinlock_wait:
sub r0, r0, #1
cmp r0, #0
subs r0, r0, #1
bgt spinlock_wait
bx lr