[haiku-commits] Change in haiku[master]: sparc: workaround for Netra T1 105

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 15 Mar 2020 16:22:25 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2356 ;)


Change subject: sparc: workaround for Netra T1 105
......................................................................

sparc: workaround for Netra T1 105

The address-size property is missing, but we don't really need it.
---
M src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp
1 file changed, 9 insertions(+), 4 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/56/2356/1

diff --git a/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp 
b/src/system/boot/platform/openfirmware/arch/sparc/mmu.cpp
index 28a7027..8b61d21 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 @@
        // #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

--
To view, visit https://review.haiku-os.org/c/haiku/+/2356
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Iff3de89c811d16a263eadf796a0e6eb157dbe18b
Gerrit-Change-Number: 2356
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: sparc: workaround for Netra T1 105 - Gerrit