Skip to content

Added Pi4 Support #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Raspberry.System/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,17 @@ public Processor Processor
get
{
Processor processor;
return Enum.TryParse(ProcessorName, true, out processor) ? processor : Processor.Unknown;
if (Enum.TryParse(ProcessorName, true, out processor))
{
// Check to see if we're dealing with a Pi 4 Model B
// The Pi 4 Model B currently lies to us and tells us that it's a BCM2835
if (processor == Processor.Bcm2835 && Model == Model.Pi4)
processor = Processor.Bcm2711;

return processor;
}

return Processor.Unknown;
}
}

Expand Down Expand Up @@ -245,7 +255,8 @@ private Model LoadModel()

case 0x2082:
return Model.B3;

case 0x03111:
return Model.Pi4;
default:
return Model.Unknown;
}
Expand All @@ -268,6 +279,7 @@ private ConnectorPinout LoadConnectorPinout()
case Model.B2:
case Model.Zero:
case Model.B3:
case Model.Pi4:
return ConnectorPinout.Plus;

default:
Expand Down
9 changes: 8 additions & 1 deletion Raspberry.System/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ public enum Model
/// <summary>
/// Pi 3 Model B.
/// </summary>
B3
B3,

/// <summary>
/// Pi 4
/// </summary>
Pi4
}

/// <summary>
Expand Down Expand Up @@ -93,6 +98,8 @@ public static string GetDisplayName(this Model model)
return "Raspberry Pi Zero";
case Model.B3:
return "Raspberry Pi 3 Model B";
case Model.Pi4:
return "Raspberry Pi 4 Model B";

default:
throw new ArgumentOutOfRangeException("model");
Expand Down
12 changes: 11 additions & 1 deletion Raspberry.System/Processor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ public enum Processor
/// <summary>
/// Processor is a BCM2709.
/// </summary>
Bcm2709
Bcm2709,

/// <summary>
/// Processor is BCM2711
/// </summary>
Bcm2711,

/// <summary>
/// Processor is BCM2835
/// </summary>
Bcm2835
}
}