Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A
Currently, when selecting SUPERIO_NUVOTON_NCT*_COM_A, the whole global control register 0x2a is written to 0x40. CR 0x2a defaults to 0xc0, so indeed bit 7 is cleared, but the device early init code might have set other bits in that control register, so setting it to 0x40 might override already set bits. So, only clear bit 7 and leave the other bits untouched.
Change-Id: I9ded9dab3985c4c8e5c45af354ef44af482e18c2 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/superio/nuvoton/common/early_serial.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/46286/1
diff --git a/src/superio/nuvoton/common/early_serial.c b/src/superio/nuvoton/common/early_serial.c index cc21f40..f0b49c5 100644 --- a/src/superio/nuvoton/common/early_serial.c +++ b/src/superio/nuvoton/common/early_serial.c @@ -55,7 +55,7 @@ if (CONFIG(SUPERIO_NUVOTON_NCT5539D_COM_A) || CONFIG(SUPERIO_NUVOTON_NCT6776_COM_A)) /* Route COM A to GPIO8 pin group */ - pnp_write_config(dev, 0x2a, 0x40); + pnp_unset_and_set_config(dev, 0x2a, (1 << 7), 0);
if (CONFIG(SUPERIO_NUVOTON_NCT6791D_COM_A)) /* Route COM A to GPIO8 pin group */
Hello Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46286
to look at the new patch set (#2).
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A
Currently, when selecting SUPERIO_NUVOTON_NCT*_COM_A, the whole global control register 0x2a is written to 0x40. CR 0x2a defaults to 0xc0, so indeed bit 7 is cleared, but the device early init code might have set other bits in that control register, so setting it to 0x40 might override already set bits. So, only clear bit 7 and leave the other bits untouched.
Fixes: f95daa510d ("superio/nuvoton: Add back Nuvoton NCT6776 support") Change-Id: I9ded9dab3985c4c8e5c45af354ef44af482e18c2 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/superio/nuvoton/common/early_serial.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/46286/2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/2/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/2/src/superio/nuvoton/common/... PS2, Line 58: (1 << 7) Parentheses look odd between commas. Could just be me, though.
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 2: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/2/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/2/src/superio/nuvoton/common/... PS2, Line 58: (1 << 7)
Parentheses look odd between commas. Could just be me, though.
yeah, those aren't needed; doesn't hurt to have theme there though
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 2:
I'll check if both SIOs use the same bits.
Hello build bot (Jenkins), Nico Huber, Felix Held,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/46286
to look at the new patch set (#3).
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A
Currently, when selecting SUPERIO_NUVOTON_NCT*_COM_A, the whole global control register 0x2a is written to 0x40. CR 0x2a defaults to 0xc0, so indeed bit 7 is cleared, but the device early init code might have set other bits in that control register, so setting it to 0x40 might override already set bits. So, only clear bit 7 and leave the other bits untouched.
Fixes: f95daa510d ("superio/nuvoton: Add back Nuvoton NCT6776 support") Change-Id: I9ded9dab3985c4c8e5c45af354ef44af482e18c2 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/superio/nuvoton/common/early_serial.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/46286/3
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00); Datasheet says this SIO works the same way as the other two.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
Datasheet says this SIO works the same way as the other two.
Hmmm, didn't have a datasheet. What about bit 6, though? Different default?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
Hmmm, didn't have a datasheet. […]
Looks like I misread the datasheet back in CB:33640 because it has two sections for bit 7: https://imgur.com/D2dpN12.png
Bit 6 controls COM B, as on the other SIOs.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
Looks like I misread the datasheet back in CB:33640 because it has two sections for bit 7: https://i […]
https://4donline.ihs.com/images/VipMasterIC/IC/NUTC/NUTC-S-A0001770713/NUTC-...
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
https://4donline.ihs.com/images/VipMasterIC/IC/NUTC/NUTC-S-A0001770713/NUTC-.... […]
Thanks.
So what you could have said is that it has the same default 0xc0 value. And hence clearing bit 6 is spurious. I think that deserves a separate commit, though, as it would change behavior.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
Thanks. […]
Yeah, I forgot how to English lately ._.
I'm fine with having a separate commit. There's just one board with this SIO.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... File src/superio/nuvoton/common/early_serial.c:
https://review.coreboot.org/c/coreboot/+/46286/3/src/superio/nuvoton/common/... PS3, Line 62: pnp_write_config(dev, 0x2a, 0x00);
Yeah, I forgot how to English lately ._. […]
Done in CB:46521 and CB:46522
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
Patch Set 3: Code-Review+2
Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46286 )
Change subject: superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A ......................................................................
superio/nuvoton: Only set bit 7 of global CR 0x2a for COM A
Currently, when selecting SUPERIO_NUVOTON_NCT*_COM_A, the whole global control register 0x2a is written to 0x40. CR 0x2a defaults to 0xc0, so indeed bit 7 is cleared, but the device early init code might have set other bits in that control register, so setting it to 0x40 might override already set bits. So, only clear bit 7 and leave the other bits untouched.
Fixes: f95daa510d ("superio/nuvoton: Add back Nuvoton NCT6776 support") Change-Id: I9ded9dab3985c4c8e5c45af354ef44af482e18c2 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/46286 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nico Huber nico.h@gmx.de --- M src/superio/nuvoton/common/early_serial.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/superio/nuvoton/common/early_serial.c b/src/superio/nuvoton/common/early_serial.c index cc21f40..ed5fdba 100644 --- a/src/superio/nuvoton/common/early_serial.c +++ b/src/superio/nuvoton/common/early_serial.c @@ -55,7 +55,7 @@ if (CONFIG(SUPERIO_NUVOTON_NCT5539D_COM_A) || CONFIG(SUPERIO_NUVOTON_NCT6776_COM_A)) /* Route COM A to GPIO8 pin group */ - pnp_write_config(dev, 0x2a, 0x40); + pnp_unset_and_set_config(dev, 0x2a, 1 << 7, 0);
if (CONFIG(SUPERIO_NUVOTON_NCT6791D_COM_A)) /* Route COM A to GPIO8 pin group */