FrameworkComputer / framework-system

Rust libraries and tools to interact with the Framework Computer systems
BSD 3-Clause "New" or "Revised" License
150 stars 8 forks source link

Framework 13 AMD Support on Linux #20

Open afzalarsalan opened 1 year ago

afzalarsalan commented 1 year ago

I've noticed that trying this tool on Linux runs into the issue where /dev/cros_ec doesn't seem to exist on the latest kernel. I wanted to know if there was any blockers or action items that would enable this program's functionality to work on Linux

Failure Code

Self-Test
  SMBIOS Platform:     Framework13Amd
  SMBIOS is_framework: true
  Dump EC memory region
Failed to open /dev/cros_ec. Because: Os { code: 2, kind: NotFound, message: "No such file or directory" }
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', framework_lib/src/chromium_ec/cros_ec.rs:70:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
JohnAZoidberg commented 1 year ago

You can use --driver portio to directly talk to the EC without a kernel driver. But it won't work with secureboot. See #16 But kernel driver fixes are already out there and coming soon.

becausewat commented 1 year ago

Is it intended that it's trying to talk to the CrOS EC when on an AMD board? I'm not 100% sure of the exact differences, but I'm pretty sure the EC on CrOS and non-CrOS devices serve some different functions.

sserenade commented 1 year ago

But kernel driver fixes are already out there and coming soon

Is there a mailing list thread or link one could use to track these fixes, to see what kernel version they might end up in?

OctopusET commented 1 year ago

@sserenade maybe this one? https://lore.kernel.org/lkml/ZT9VlLol-dGK5JtE@google.com/T/

prurigro commented 1 year ago

@OctopusET I just tested the patch and the kernel still doesn't provide /dev/cros_ec with it applied (thanks for taking a look though!)

prurigro commented 1 year ago

Seems like this is the patchset- I just applied it on 6.6.2 and framework_tool now functions correctly!

dyslexicjedi commented 11 months ago

You can use --driver portio to directly talk to the EC without a kernel driver. But it won't work with secureboot. See #16 But kernel driver fixes are already out there and coming soon.

This works for me. Thank you!

AkechiShiro commented 9 months ago

Hello @prurigro do you if the patchset you have shared has landed upstream yet in 6.7 ? I don't think it has but I haven't checked really thoroughly

lengau commented 9 months ago

@AkechiShiro it's not in mainline 6.8-rc5, so it's probably not in 6.7.

prurigro commented 9 months ago

Yeah, I'm still patching it in to each 6.7.x release

ufechner7 commented 7 months ago

Why not making portio the default?

stefanhoelzl commented 7 months ago

Why not making portio the default?

portio does not work when secure boot is enabled https://github.com/FrameworkComputer/framework-system/pull/16

stefanhoelzl commented 7 months ago

The patch series has been merged to the chrome platform tree for-next branch.

I guess it will then go into kernel 6.10

Agno94 commented 7 months ago

portio does not work when secure boot is enabled #16

You can temporarily lift kernel lockdown using https://github.com/blastrock/unlockdown while waiting for 6.10

elreydetoda commented 6 months ago

Seems like this is the patchset- I just applied it on 6.6.2 and framework_tool now functions correctly!

@prurigro , if you don't mind me asking, how are you doing this? I've never done that before, but I'd love to get this tool running w/o disabling Secure Boot or Kernel Lockdown. (till I get access to the 6.10 kernel)

prurigro commented 6 months ago

@elreydetoda Hey, so in Archlinux what I do is grab the package for the most recent kernel and add the patches to the build script before running it (ie: patch -Np1 < ../1.patch for each of the four patches). I'll drop them in an archive here so you don't have to dig them out of the mailing list.

Let me know if you need more detail in one direction or another- I didn't want to go too in depth considering how different an experience it would be depending on the distro you're using.

framework-system-amd-support.tar.gz

prurigro commented 4 months ago

I just tested the 6.10.2 release without any patches and framework_tool works with secure boot enabled. I believe this issue can be closed :)