Skip to content

Commit

Permalink
Fix compile error and active github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
creatoy committed Jul 27, 2024
1 parent 9c45bde commit 4f90d0e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dtoverlaycheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ jobs:
sudo make install
cd ${{github.workspace}}
pwd
make ARCH=arm KERNEL=kernel CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_defconfig
make ARCH=arm KERNEL=kernel CROSS_COMPILE=arm-linux-gnueabihf- bcm2711_rust_defconfig
make ARCH=arm KERNEL=kernel CROSS_COMPILE=arm-linux-gnueabihf- dtbs
${{env.UTILS_DIR}}/overlaycheck/overlaycheck
75 changes: 40 additions & 35 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Pi kernel build tests

on:
pull_request:
paths-ignore:
- '.github/**'
branches: [ "rpi-*" ]
push:
paths-ignore:
- '.github/**'
branches: [ "rpi-*" ]
# pull_request:
# paths-ignore:
# - '.github/**'
# branches: [ "rpi-*" ]
# push:
# paths-ignore:
# - '.github/**'
# branches: [ "rpi-*" ]
workflow_dispatch:

env:
Expand All @@ -20,40 +20,45 @@ jobs:
strategy:
matrix:
include:
- name: bcm2835
- name: bcm2711_rust
arch: arm
defconfig: bcm2835_defconfig
kernel: kernel
defconfig: bcm2711_rust_defconfig
kernel: kernel7l

- name: arm64
arch: arm64
defconfig: defconfig
kernel: kernel8
# - name: bcm2835
# arch: arm
# defconfig: bcm2835_defconfig
# kernel: kernel

- name: bcmrpi
arch: arm
defconfig: bcmrpi_defconfig
kernel: kernel
# - name: arm64
# arch: arm64
# defconfig: defconfig
# kernel: kernel8

- name: bcm2709
arch: arm
defconfig: bcm2709_defconfig
kernel: kernel7
# - name: bcmrpi
# arch: arm
# defconfig: bcmrpi_defconfig
# kernel: kernel

- name: bcm2711
arch: arm
defconfig: bcm2711_defconfig
kernel: kernel7l
# - name: bcm2709
# arch: arm
# defconfig: bcm2709_defconfig
# kernel: kernel7

# - name: bcm2711
# arch: arm
# defconfig: bcm2711_defconfig
# kernel: kernel7l

- name: bcm2711_arm64
arch: arm64
defconfig: bcm2711_defconfig
kernel: kernel8
# - name: bcm2711_arm64
# arch: arm64
# defconfig: bcm2711_defconfig
# kernel: kernel8

- name: bcm2712
arch: arm64
defconfig: bcm2712_defconfig
kernel: kernel_2712
# - name: bcm2712
# arch: arm64
# defconfig: bcm2712_defconfig
# kernel: kernel_2712

steps:
- name: Update install
Expand Down
6 changes: 3 additions & 3 deletions drivers/i2c/busses/i2c_bcm2835_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ fn clk_bcm2835_i2c_set_rate(hw: &mut ClkHw, rate: u32, parent_rate: u32) -> Resu
Ok(())
}

fn clk_bcm2835_i2c_round_rate(hw: &mut ClkHw, rate: u64, parent_rate: &mut u64) -> u64 {
fn clk_bcm2835_i2c_round_rate(hw: &mut ClkHw, rate: u32, parent_rate: &mut u32) -> u32 {
let divider = clk_bcm2835_i2c_calc_divider(rate, *parent_rate).unwrap();

*parent_rate.div_ceil(divider)
parent_rate.div_ceil(divider)
}

fn clk_bcm2835_i2c_recalc_rate(hw: &mut ClkHw, parent_rate: u64) -> u64 {
fn clk_bcm2835_i2c_recalc_rate(hw: &mut ClkHw, parent_rate: u32) -> u32 {
let div = to_clk_bcm2835_i2c(hw);
let divider = bcm2835_i2c_readl(&mut div.i2c_dev, BCM2835_I2C_DIV);

Expand Down
10 changes: 6 additions & 4 deletions rust/kernel/clk_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use crate::{
bindings,
error::{to_result, Result},
str::CStr,
types::Opaque,
};

Expand All @@ -26,7 +27,7 @@ pub struct ClkDuty(bindings::clk_duty);
/// # Invariants
///
/// The pointer is valid.
pub struct ClkHw(bindings::clk_hw);
pub struct ClkHw(Opaque<bindings::clk_hw>);

impl ClkHw {
/// Create ClkHw from raw ptr
Expand Down Expand Up @@ -86,14 +87,15 @@ impl Drop for ClkHw {
// unsafe fn devm_clk_hw_register() -> Result {}

/// Represents `struct clk_ops`
pub struct ClkOps(bindings::clk_ops);
pub struct ClkOps(Opaque<bindings::clk_ops>);

// TODO: Create (new) from functions ptr
impl ClkOps {
// TODO!
pub fn from_raw(ptr: *const bindings::clk_ops) -> Self {
let ptr = ptr.cast::<Self>();
unsafe { &*ptr }
// let ptr = ptr.cast::<Self>();
// unsafe { *ptr }
unimplemented!()
}

#[inline]
Expand Down

0 comments on commit 4f90d0e

Please sign in to comment.