Skip to content

pmgr: support M4 Pro/Max / A18 Pro / M5#578

Open
yuyuyureka wants to merge 2 commits into
AsahiLinux:mainfrom
yuyuyureka:new-pmgr
Open

pmgr: support M4 Pro/Max / A18 Pro / M5#578
yuyuyureka wants to merge 2 commits into
AsahiLinux:mainfrom
yuyuyureka:new-pmgr

Conversation

@yuyuyureka
Copy link
Copy Markdown
Contributor

@yuyuyureka yuyuyureka commented May 9, 2026

This fixes on m1n1 device-mode USB on the M5 Max MacBook Pro

@yuyuyureka yuyuyureka force-pushed the new-pmgr branch 3 times, most recently from a81cb92 to f1cb5cb Compare May 10, 2026 10:01
@yuyuyureka yuyuyureka changed the title support M4 Pro/Max / A18 Pro / M5 pmgr pmgr: support M4 Pro/Max / A18 Pro / M5 May 10, 2026
@flokli
Copy link
Copy Markdown
Contributor

flokli commented May 10, 2026

Can confirm this successfully spins up on an M4 Pro:

cat /dev/ttyACM0:

Initialized dockchannel UART at 0x508828000
Device info:
  Model: Mac16,11
  Target: J773s
  Board-ID: 0x2
  Chip-ID: 0x6040

CPU init (MIDR: 0x611f0551 smp_id:0x4)...
  CPU part: 0x55 rev: 0x11
  CPU: Unknown

boot_args at 0x10002848000
  revision:     3
  version:      2
  virt_base:    0x1b2bc000
  phys_base:    0x100012bc000
  mem_size:     0x5df06c000
  top_of_kdata: 0x10002858000
  video:
    base:       0x105e5b08000
    display:    0x1
    stride:     0xa00
    width:      640
    height:     1136
    depth:      32bpp
    density:    1
  machine_type: 0
  devtree:      0x1c000000
  devtree_size: 0x80000
  cmdline:      
  boot_flags:   0x0
  mem_size_act: 0x600000000



m1n1 v1.6.0-rc1-12-g68598a1
Copyright The Asahi Linux Contributors
Licensed under the MIT license

Running in EL2

OS FW version: 26.4 (mBoot-18000.101.7)
System FW version: 26.4 (mBoot-18000.101.7)
Heap base: 0x10002858000
MCC: Unsupported version:mcc,t6041
MMU: Initializing...
MMU: RAM base: 0x10000000000
MMU: Top of normal RAM: 0x105e0328000
MMU: Adding Device-nGnRE mapping at 0xbc0000000 (0x20000000)
MMU: Adding Device-nGnRE mapping at 0xb80000000 (0x40000000)
MMU: Adding Device-nGnRE mapping at 0x1cb0000000 (0x1c000)
MMU: Adding Device-nGnRE mapping at 0x800000000 (0x200000000)
MMU: Adding Device-nGnRE mapping at 0xa00000000 (0x80000000)
MMU: Adding Device-nGnRE mapping at 0x1c50000000 (0x4000)
MMU: Adding Device-nGnRE mapping at 0xc00000000 (0x200000000)
MMU: Adding Device-nGnRE mapping at 0xe00000000 (0x80000000)
MMU: Adding Device-nGnRE mapping at 0x1c60000000 (0x4000)
MMU: Adding Device-nGnRE mapping at 0x1000000000 (0x200000000)
MMU: Adding Device-nGnRE mapping at 0x1200000000 (0x80000000)
MMU: Adding Device-nGnRE mapping at 0x1c70000000 (0x4000)
MMU: Adding Device-nGnRE mapping at 0x1400000000 (0x200000000)
MMU: Adding Device-nGnRE mapping at 0x1600000000 (0x80000000)
MMU: Adding Device-nGnRE mapping at 0x1c80000000 (0x4000)
MMU: Adding Normal-NC mapping at 0x105ffeb8000 (0x20000)
MMU: Adding Normal-NC mapping at 0x105ffe78000 (0x10000)
MMU: Adding Normal-NC mapping at 0x105ffe58000 (0x20000)
MMU: Adding Normal-NC mapping at 0x105ffe18000 (0x10000)
MMU: Adding Normal-NC mapping at 0x105ffdf8000 (0x20000)
MMU: Adding Normal-NC mapping at 0x105ffdb8000 (0x10000)
MMU: Adding Normal-NC mapping at 0x105fffb8000 (0x4000)
MMU: Adding Normal-NC mapping at 0x105fff70000 (0x4000)
MMU: SCTLR_EL1: 30000180 -> 30901085
MMU: running with MMU and caches enabled!
AIC: Version 3 @ 0x502400000
AIC: AIC3 with 1/2 dies, 2720/4096 IRQs, reg_size:40004, config:10000, extintrcfg_stride:04a00, intmaskset_stride:04a00, intmaskclear_stride:04a00
AIC: Configuring 1 external interrupts
WDT registers @ 0x50836c000 (0x508330008)
WDT disabled
pmgr: Cleaning up device states...
pmgr: Enabling 0.ATC0_COMMON, parent of active device ATC0_USB
pmgr: Enabling 0.ATC1_COMMON, parent of active device ATC1_USB
pmgr: Enabling 0.ATC2_COMMON, parent of active device ATC2_USB
pmgr: Enabling 0.ATC3_COMMON, parent of active device ATC3_USB
pmgr: initialized, 485 devices on 1 dies found.
/arm-io/disp0 node not found!
fb init: 640x1136 (32) [s=640] @0x105e5b08000
fb console: max rows 35, max cols 40
fb: display logo
cpufreq: Chip 0x6040 is unsupported
Initialization complete.
Checking for payloads...
Devicetree compatible value: apple,j773s
Unknown payload at 0x100021f4000 (magic: 5b41464b)
No valid payload found
dart: dart /arm-io/dart-usb0 at 0x382f80000 is a t8110
USB0: initialized at 0x10002c1e030
dart: dart /arm-io/dart-usb1 at 0x38af80000 is a t8110
USB1: initialized at 0x10002c1e360
dart: dart /arm-io/dart-usb2 at 0x392f80000 is a t8110
USB2: initialized at 0x10002c1e690
dart: dart /arm-io/dart-usb3 at 0x39af80000 is a t8110
USB3: initialized at 0x10002c1e9c0
Running proxy...

Comment thread src/pmgr.c Outdated
uintptr_t addr = pmgr_get_psreg(device->psreg_idx);
uintptr_t addr;
if (pmgr_use_group_and_offset)
addr = pmgr_get_psreg(device->group_and_offset >> 24);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use GENMASK and FIELD_GET/PREP to extract the group and the offset here or alternatively something like u32 group : 8; u32 offset : 24; in the struct definition

Comment thread proxyclient/m1n1/adt.py Outdated
"pd" / Int8ul,
"ps_cfg16" / Int8ul,
"unk2_1" / Int32ul,
"group_and_offset" / Int32ul,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

construct has a 24bit integer type so there's no need to combine those two into a 32bit integer here

Signed-off-by: Yureka <yureka@cyberchaos.dev>
Re-used PMGRPSRegs. In all 25.4.1 device trees, all but reg is zero

Signed-off-by: Yureka <yureka@cyberchaos.dev>
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.

3 participants