Skip to content
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

Add ADT and m1n1 stage 2 log as MTD phram reserved memory nodes #399

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

jannau
Copy link
Member

@jannau jannau commented Aug 10, 2024

Requires for easy access CONFIG_MTD_PHRAM but I guess can be still accesses through /dev/mem on systems missing this.

The additional IODEV for the log console is a little bit ugly since it can't be added before IODEV_USB0 to keep backwards compatibility with python m1n1 but it shouldn't be handled like the USB IODEVs.

Requires CONFIG_MTD_PHRAM in Linux.

Signed-off-by: Janne Grunau <[email protected]>
This registers a log buffer IODEV similar to the frame buffer IODEV. It
is using a console IODEV to allow writing to the buffer until m1n1 jumps
to the next stage. This allows also to increase the buffer size without
increasing m1n1's size. The current CONSOLE_BUFFER_SIZE of 8k is not
large enough to hold the entire log of executing m1n1 under the
hypervisor on the M1 Ultra Mac Studio.

Signed-off-by: Janne Grunau <[email protected]>
@jannau
Copy link
Member Author

jannau commented Aug 10, 2024

hexdump -C /dev/mtd/by-name/adt and cat /dev/mtd/by-name/m1n1_stage2.log produce the expected results

@marcan
Copy link
Member

marcan commented Sep 24, 2024

Nice!

@marcan marcan merged commit 48837f4 into AsahiLinux:main Sep 24, 2024
3 checks passed
jannau added a commit to jannau/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
jannau added a commit to jannau/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
jannau added a commit to jannau/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
jannau added a commit to jannau/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
WhatAmISupposedToPutHere pushed a commit to WhatAmISupposedToPutHere/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
WhatAmISupposedToPutHere pushed a commit to WhatAmISupposedToPutHere/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
WhatAmISupposedToPutHere pushed a commit to WhatAmISupposedToPutHere/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
WhatAmISupposedToPutHere pushed a commit to WhatAmISupposedToPutHere/asahi-nvram that referenced this pull request Sep 28, 2024
"nvram" will not be the sole MTD device on AsahiLinux devices with
m1n1-1.4.16 (AsahiLinux/m1n1#399) and
CONFIG_MTD_PHRAM. Use "/dev/mtd/by-name/nvram" instead of "/dev/mtd0".

Signed-off-by: Janne Grunau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants