From 75f57bdd1b949967624930461f7c861688b9431c Mon Sep 17 00:00:00 2001 From: Evan Lojewski Date: Tue, 26 Feb 2019 23:14:00 -0700 Subject: Aquire the APE lock before configuring the MII ports. --- stage1/CMakeLists.txt | 4 ++-- stage1/init_hw.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'stage1') diff --git a/stage1/CMakeLists.txt b/stage1/CMakeLists.txt index 1a6bd9e..4c58c9d 100644 --- a/stage1/CMakeLists.txt +++ b/stage1/CMakeLists.txt @@ -52,7 +52,7 @@ mips_add_executable(${PROJECT_NAME} main.c crt.s) -target_link_libraries(${PROJECT_NAME} NVRam-mips MII-mips VPD-mips) +target_link_libraries(${PROJECT_NAME} NVRam-mips MII-mips VPD-mips APE-mips) target_link_libraries(${PROJECT_NAME} bcm5719) target_compile_options(${PROJECT_NAME} PRIVATE -nodefaultlibs) target_link_libraries(${PROJECT_NAME} "--script=${LINKER_SCRIPT}") @@ -65,4 +65,4 @@ simulator_add_executable(sim-${PROJECT_NAME} main.c) target_link_libraries(sim-${PROJECT_NAME} simulator) -target_link_libraries(sim-${PROJECT_NAME} NVRam MII VPD) +target_link_libraries(sim-${PROJECT_NAME} NVRam MII VPD APE) diff --git a/stage1/init_hw.c b/stage1/init_hw.c index 1f087f1..9bf5fc2 100644 --- a/stage1/init_hw.c +++ b/stage1/init_hw.c @@ -45,6 +45,7 @@ #include "stage1.h" #include +#include #include #include #include @@ -464,11 +465,13 @@ void init_hw(NVRAMContents_t *nvram) reportStatus(STATUS_INIT_HW, 0xf0); // Perform MII init. + APE_aquireLock(); init_mii_function0(); reportStatus(STATUS_INIT_HW, 0xfe); init_mii(); + APE_releaseLock(); reportStatus(STATUS_INIT_HW, 0xff); } -- cgit v1.2.1