Skip to content

Commit 5297dbf

Browse files
committed
Add support for Raspberry Pi 500
1 parent 21aec81 commit 5297dbf

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Diff for: src/system.rs

+17-11
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ pub enum Model {
8080
RaspberryPi4B,
8181
RaspberryPi400,
8282
RaspberryPi5,
83+
RaspberryPi500,
8384
RaspberryPiComputeModule,
8485
RaspberryPiComputeModule3,
8586
RaspberryPiComputeModule3Plus,
@@ -106,6 +107,7 @@ impl fmt::Display for Model {
106107
Model::RaspberryPi4B => write!(f, "Raspberry Pi 4 B"),
107108
Model::RaspberryPi400 => write!(f, "Raspberry Pi 400"),
108109
Model::RaspberryPi5 => write!(f, "Raspberry Pi 5"),
110+
Model::RaspberryPi500 => write!(f, "Raspberry Pi 500"),
109111
Model::RaspberryPiComputeModule => write!(f, "Raspberry Pi Compute Module"),
110112
Model::RaspberryPiComputeModule3 => write!(f, "Raspberry Pi Compute Module 3"),
111113
Model::RaspberryPiComputeModule3Plus => write!(f, "Raspberry Pi Compute Module 3+"),
@@ -210,7 +212,7 @@ fn parse_proc_cpuinfo() -> Result<Model> {
210212
0x14 => Model::RaspberryPiComputeModule4,
211213
0x15 => Model::RaspberryPiComputeModule4S,
212214
0x17 => Model::RaspberryPi5,
213-
0x18 => Model::RaspberryPiComputeModule5,
215+
0x19 => Model::RaspberryPi500,
214216
_ => return Err(Error::UnknownModel),
215217
}
216218
} else {
@@ -253,6 +255,7 @@ fn parse_base_compatible() -> Result<Model> {
253255
"raspberrypi,4-compute-module-s" => Model::RaspberryPiComputeModule4S,
254256
"raspberrypi,5-model-b" => Model::RaspberryPi5,
255257
"raspberrypi,5-compute-module" => Model::RaspberryPiComputeModule5,
258+
"raspberrypi,500" => Model::RaspberryPi500,
256259
_ => continue,
257260
};
258261

@@ -317,6 +320,7 @@ fn parse_base_model() -> Result<Model> {
317320
"Raspberry Pi Compute Module 4S" => Model::RaspberryPiComputeModule4S,
318321
"Raspberry Pi 5 Model B" => Model::RaspberryPi5,
319322
"Raspberry Pi Compute Module 5" => Model::RaspberryPiComputeModule5,
323+
"Raspberry Pi 500" => Model::RaspberryPi500,
320324
_ => return Err(Error::UnknownModel),
321325
};
322326

@@ -419,16 +423,18 @@ impl DeviceInfo {
419423
pwm_chip: 0,
420424
pwm_channels: [0, 1],
421425
}),
422-
Model::RaspberryPi5 | Model::RaspberryPiComputeModule5 => Ok(DeviceInfo {
423-
model,
424-
soc: SoC::Bcm2712,
425-
peripheral_base: PERIPHERAL_BASE_RP1,
426-
gpio_offset: GPIO_OFFSET_RP1,
427-
gpio_lines: GPIO_LINES_RP1,
428-
gpio_interface: GpioInterface::Rp1,
429-
pwm_chip: 2,
430-
pwm_channels: [2, 3],
431-
}),
426+
Model::RaspberryPi5 | Model::RaspberryPi500 | Model::RaspberryPiComputeModule5 => {
427+
Ok(DeviceInfo {
428+
model,
429+
soc: SoC::Bcm2712,
430+
peripheral_base: PERIPHERAL_BASE_RP1,
431+
gpio_offset: GPIO_OFFSET_RP1,
432+
gpio_lines: GPIO_LINES_RP1,
433+
gpio_interface: GpioInterface::Rp1,
434+
pwm_chip: 2,
435+
pwm_channels: [2, 3],
436+
})
437+
}
432438
}
433439
}
434440

0 commit comments

Comments
 (0)