summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2021-06-13 22:04:58 -0600
committerGitHub <noreply@github.com>2021-06-13 22:04:58 -0600
commitc99d0b237253fa1a8d7bd0e2db5843ae49949f5f (patch)
tree900a4a7a93b2569e530230dc9331b1fcd09bf4d4
parent388f0dce16f9847e8a9368569639f4c60c1bf3be (diff)
downloadbcm5719-ortega-c99d0b237253fa1a8d7bd0e2db5843ae49949f5f.tar.gz
bcm5719-ortega-c99d0b237253fa1a8d7bd0e2db5843ae49949f5f.zip
stage1: Fix a contention issue on the NVRam that could cause Linux to fail to initialize properly. (#221)
-rw-r--r--stage1/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stage1/main.c b/stage1/main.c
index 8d69c15..fee8f87 100644
--- a/stage1/main.c
+++ b/stage1/main.c
@@ -46,6 +46,8 @@
#define MAX_VPD_SUPPORTED (512u) /* Buffer size for caching VPD data. */
+#define NVRAM_PRINTF 0 /* This code causes a race condition with linux during initializaiton that can cause it to fail to read nvram. */
+
#ifdef CXX_SIMULATOR
#include <HAL.hpp>
#define crc_swap(__x__) (__x__) /* No swapping needed on the host */
@@ -86,6 +88,7 @@ void init_once(void)
SHM.RcpuSegLength.r32 = 0x34;
}
+#if NVRAM_PRINTF
void handle_printf()
{
uint32_t buffer_size = ARRAY_ELEMENTS(SHM.RcpuPrintfBuffer) * sizeof(uint32_t);
@@ -113,6 +116,7 @@ void handle_printf()
SHM.RcpuReadPointer.r32 = ++cached_pointer;
}
}
+#endif
void handle_vpd()
{
@@ -242,6 +246,7 @@ int main()
GEN.GenAsfStatusMbox.r32 = GEN_GEN_FW_MBOX_MBOX_BOOTCODE_READY;
// Do main loop.
+#if NVRAM_PRINTF
if (0 == DEVICE.Status.bits.FunctionNumber)
{
for (;;)
@@ -254,6 +259,7 @@ int main()
}
}
else
+#endif
{
for (;;)
{
OpenPOWER on IntegriCloud