From 5424c3a22ec247e6d3bf35121e537eb06a270622 Mon Sep 17 00:00:00 2001 From: PulkoMandy Date: Sat, 14 Mar 2020 21:42:35 +0100 Subject: [PATCH] sparc: workaround for Netra T1 105 The address-size property is missing, but we don't really need it. Change-Id: Iff3de89c811d16a263eadf796a0e6eb157dbe18b Reviewed-on: https://review.haiku-os.org/c/haiku/+/2356 Reviewed-by: waddlesplash --- .../boot/platform/openfirmware/arch/sparc/mmu.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp b/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp index 28a70272d3..8b61d21c62 100644 --- a/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp +++ b/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp @@ -80,14 +80,19 @@ find_physical_memory_ranges(size_t &total) // #address-cells and #size-cells matches the number of 32-bit 'cells' // representing the length of the base address and size fields intptr_t root = of_finddevice("/"); - int32 regAddressCells = of_address_cells(root); int32 regSizeCells = of_size_cells(root); - if (regAddressCells == OF_FAILED || regSizeCells == OF_FAILED) { - dprintf("finding base/size length counts failed, assume 32-bit.\n"); - regAddressCells = 1; + if (regSizeCells == OF_FAILED) { + dprintf("finding size of memory cells failed, assume 32-bit.\n"); regSizeCells = 1; } + int32 regAddressCells = of_address_cells(root); + if (regAddressCells == OF_FAILED) { + // Sun Netra T1-105 is missing this, but we can guess that if the size + // is 64bit, the address also likely is. + regAddressCells = regSizeCells; + } + if (regAddressCells != 2 || regSizeCells != 2) { panic("%s: Unsupported OpenFirmware cell count detected.\n" "Address Cells: %" B_PRId32 "; Size Cells: %" B_PRId32