Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/macppc/dev



Hello,

On Mon, 29 Sep 2025 22:47:44 +0900
Rin Okuyama <rokuyama.rk%gmail.com@localhost> wrote:

> >> Module Name:	src
> >> Committed By:	thorpej
> >> Date:		Sun Sep 28 11:32:23 UTC 2025
> >>
> >> Modified Files:
> >> 	src/sys/arch/macppc/dev: ki2c.c
> >>
> >> Log Message:
> >> There are PowerMac G5 11.2 units in the wild with an OFW device tree containing
> >> 2 "i2c-bus@0" nodes on the mac-io ki2c, each containing audio codec ICs.
> >> Work around this apparent error in the OFW device tree by skipping the channel
> >> if it's already been initialized.
> >>
> >> Patch provided by rin@, tweaked slightly to add a debug log breadcrumb.
> >>
> >> PR port-macppc/59673.  
> > 
> > It's depressingly common, my 11,2 has this:
> > 
> > ff994c50: /ht@0,f2000000/pci@4000,0,0/mac-io@7/i2c@18000/i2c-bus@0
> > 
> > #address-cells          00000001 ........ ........ ........     1
> > #size-cells             00000000 ........ ........ ........     0
> > built-in
> > compatible              6932632d 62757300 ........ ........   "i2c-bus"
> >              0008:       6b657977 6573742d 6932632d 62757300   "keywest-i2c-bus"
> >              0018:       00...... ........ ........ ........   ""
> > device_type             6932632d 62757300 ........ ........   "i2c-bus"
> > name                    6932632d 62757300 ........ ........   "i2c-bus"
> > reg                     00000000 ........ ........ ........   ....
> > 
> > --------------------------------------------------------------------------------
> > 
> > 
> > ff994e18: /ht@0,f2000000/pci@4000,0,0/mac-io@7/i2c@18000/i2c-bus@0/codec@8c
> > 
> > built-in
> > compatible              70636d33 30353200 ........ ........   "pcm3052"
> >              0008:       636f6465 6300.... ........ ........   "codec"
> >              000e:       00...... ........ ........ ........   ""
> > device_type             636f6465 6300.... ........ ........   "codec"
> > name                    636f6465 6300.... ........ ........   "codec"
> > platform-do-onyx-codec-ref
> >                          ff995740 08000000 00000027 ........   ..W@.......'
> > reg                     0000008c ........ ........ ........   ....
> > 
> > --------------------------------------------------------------------------------
> > 
> > 
> > ff994f50: /ht@0,f2000000/pci@4000,0,0/mac-io@7/i2c@18000/i2c-bus@0/codec@24
> > 
> > built-in
> > compatible              63733834 313600.. ........ ........   "cs8416"
> >              0007:       636f6465 6300.... ........ ........   "codec"
> >              000d:       00...... ........ ........ ........   ""
> > device_type             636f6465 6300.... ........ ........   "codec"
> > name                    636f6465 6300.... ........ ........   "codec"
> > platform-do-topaz-codec-ref
> >                          ff995a88 08000000 00000027 ........   ..Z........'
> > reg                     00000024 ........ ........ ........   ...$
> > 
> > --------------------------------------------------------------------------------
> > 
> > 
> > ff995088: /ht@0,f2000000/pci@4000,0,0/mac-io@7/i2c@18000/i2c-bus@0
> > 
> > #address-cells          00000001 ........ ........ ........     1
> > #size-cells             00000000 ........ ........ ........     0
> > built-in
> > compatible              6932632d 62757300 ........ ........   "i2c-bus"
> >              0008:       6b657977 6573742d 6932632d 62757300   "keywest-i2c-bus"
> >              0018:       00...... ........ ........ ........   ""
> > device_type             6932632d 62757300 ........ ........   "i2c-bus"
> > name                    6932632d 62757300 ........ ........   "i2c-bus"
> > reg                     00000000 ........ ........ ........   ....
> > 
> > --------------------------------------------------------------------------------
> > 
> > ff995250: /ht@0,f2000000/pci@4000,0,0/mac-io@7/i2c@18000/i2c-bus@0/codec@8c
> > 
> > built-in
> > compatible              70636d33 30353200 ........ ........   "pcm3052"
> >              0008:       636f6465 6300.... ........ ........   "codec"
> >              000e:       00...... ........ ........ ........   ""
> > device_type             636f6465 6300.... ........ ........   "codec"
> > name                    636f6465 6300.... ........ ........   "codec"
> > reg                     0000008c ........ ........ ........   ....
> > 
> > 
> > note that the 2nd i2c-bus@0 node only has one codec. I wouldn't bet on
> > the good node always being the first either.  
> 
> Hmm, at least your 11,2 and mine have the good node at
> the first although... For the completeness, enumerate
> the child nodes to determine which to be used?

I'd probably leave it alone for now, until we run into counter-examples :/
Mostly because the child nodes are not identical, the 'good' ones
contain properties pointing at the appropriate i2s channel, the others
do not, which makes the 2nd bus node look like lefftover.
Who knows what other varieties are out there.
Maybe we should scan the 2nd i2cbus for devices with i2c addresses not
present in the 1st, then again that's solving a problem we don't know
exists in real life.

have fun
Michael


Home | Main Index | Thread Index | Old Index