[PATCH] 86xx: Enable the AC97 interface on 8641D board.

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE7041d REVIEWED: 1 (0M)

1 review trailer.

16 messages, 5 authors, 2007-05-10 · open the first message on its own page

[PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-02 21:53:46

From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are enabled at
the same time, In order to use AC97 interface, we need to disable the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 3d3d98f..13a14dd 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -168,7 +168,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
 {
 	unsigned short temp;
 	struct pci_controller *hose = pci_bus_to_host(dev->bus);
-	unsigned char irq2pin[16];
+	unsigned char irq2pin[16], c;
 	unsigned long pirq_map_word = 0;
 	u32 irq;
 	int i;
@@ -288,6 +288,11 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
 	outb(0x1e, 0x4d1);
 
 #undef ULI1575_SET_DEV_IRQ
+
+	/* Disable the HD interface and enable the AC97 interface. */
+	pci_read_config_byte(dev, 0xb8, &c);
+	c &= 0x7f;
+	pci_write_config_byte(dev, 0xb8, c);
 }
 
 static void __devinit quirk_uli5288(struct pci_dev *dev)
-- 
1.5.0.3

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Kumar Gala <hidden>
Date: 2007-05-03 14:45:57

On May 2, 2007, at 4:53 PM, Jon Loeliger wrote:
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are  
enabled at
the same time, In order to use AC97 interface, we need to disable  
the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Is the HD feature not used at all?  Is there a AC97 Driver CONFIG_  
that makes sense to wrap that with?  Just wondering about the mutual  
exclusion (and how to provide flexibility to the user).

- k
quoted hunk
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/ 
powerpc/platforms/86xx/mpc86xx_hpcn.c
index 3d3d98f..13a14dd 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -168,7 +168,7 @@ static void __devinit quirk_uli1575(struct  
pci_dev *dev)
 {
 	unsigned short temp;
 	struct pci_controller *hose = pci_bus_to_host(dev->bus);
-	unsigned char irq2pin[16];
+	unsigned char irq2pin[16], c;
 	unsigned long pirq_map_word = 0;
 	u32 irq;
 	int i;
@@ -288,6 +288,11 @@ static void __devinit quirk_uli1575(struct  
pci_dev *dev)
 	outb(0x1e, 0x4d1);

 #undef ULI1575_SET_DEV_IRQ
+
+	/* Disable the HD interface and enable the AC97 interface. */
+	pci_read_config_byte(dev, 0xb8, &c);
+	c &= 0x7f;
+	pci_write_config_byte(dev, 0xb8, c);
 }

 static void __devinit quirk_uli5288(struct pci_dev *dev)
-- 
1.5.0.3



_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-03 15:55:33

On Thu, 2007-05-03 at 09:44, Kumar Gala wrote:
On May 2, 2007, at 4:53 PM, Jon Loeliger wrote:
quoted
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are  
enabled at
the same time, In order to use AC97 interface, we need to disable  
the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Is the HD feature not used at all?  Is there a AC97 Driver CONFIG_  
that makes sense to wrap that with?  Just wondering about the mutual  
exclusion (and how to provide flexibility to the user).

- k

The ULI supports both the HD and AC97 interfaces, but the 8641
only supports the AC97 interface.  Thus we can straight disable
the HD and convert/configure the shared pins to be AC97.  Thus,
there is no real CONFIG_ need at all.  It's only AC97.  And then
ultimately, the presence of sound support is controlled by
the ALSA config options as per normal.

Thanks,
jdl

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Kumar Gala <hidden>
Date: 2007-05-03 16:01:59

On May 3, 2007, at 10:55 AM, Jon Loeliger wrote:
On Thu, 2007-05-03 at 09:44, Kumar Gala wrote:
quoted
On May 2, 2007, at 4:53 PM, Jon Loeliger wrote:
quoted
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are
enabled at
the same time, In order to use AC97 interface, we need to disable
the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Is the HD feature not used at all?  Is there a AC97 Driver CONFIG_
that makes sense to wrap that with?  Just wondering about the mutual
exclusion (and how to provide flexibility to the user).

- k

The ULI supports both the HD and AC97 interfaces, but the 8641
only supports the AC97 interface.  Thus we can straight disable
the HD and convert/configure the shared pins to be AC97.  Thus,
there is no real CONFIG_ need at all.  It's only AC97.  And then
ultimately, the presence of sound support is controlled by
the ALSA config options as per normal.
Ok.  I'm guessing HD here isn't hard disk, but some audio thing.

- k

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-03 16:03:25

On Thu, 2007-05-03 at 11:01, Kumar Gala wrote:

Ok.  I'm guessing HD here isn't hard disk, but some audio thing.
That is correct.

jdl

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Olof Johansson <hidden>
Date: 2007-05-03 16:08:41

On Thu, May 03, 2007 at 10:55:25AM -0500, Jon Loeliger wrote:
On Thu, 2007-05-03 at 09:44, Kumar Gala wrote:
quoted
On May 2, 2007, at 4:53 PM, Jon Loeliger wrote:
quoted
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are  
enabled at
the same time, In order to use AC97 interface, we need to disable  
the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Is the HD feature not used at all?  Is there a AC97 Driver CONFIG_  
that makes sense to wrap that with?  Just wondering about the mutual  
exclusion (and how to provide flexibility to the user).

- k

The ULI supports both the HD and AC97 interfaces, but the 8641
only supports the AC97 interface.  Thus we can straight disable
the HD and convert/configure the shared pins to be AC97.  Thus,
there is no real CONFIG_ need at all.  It's only AC97.  And then
ultimately, the presence of sound support is controlled by
the ALSA config options as per normal.
This sounds like something that firmware should take care of, not
hardcoded in the board code.  Seems like the device is just a PCI device
that doesn't have a device tree entry.

Why not do this in u-boot instead?


-Olof

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-03 16:17:47

On Thu, 2007-05-03 at 11:10, Olof Johansson wrote:
This sounds like something that firmware should take care of, not
hardcoded in the board code.  Seems like the device is just a PCI device
that doesn't have a device tree entry.
Well, it's not a PCI device at all.
Why not do this in u-boot instead?
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.

jdl

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Kumar Gala <hidden>
Date: 2007-05-03 16:20:23

On May 3, 2007, at 11:17 AM, Jon Loeliger wrote:
On Thu, 2007-05-03 at 11:10, Olof Johansson wrote:
quoted
This sounds like something that firmware should take care of, not
hardcoded in the board code.  Seems like the device is just a PCI  
device
that doesn't have a device tree entry.
Well, it's not a PCI device at all.
quoted
Why not do this in u-boot instead?
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.
I agree with Jon here.  This is in board specific code so I don't see  
any issue with it.

- k

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Olof Johansson <hidden>
Date: 2007-05-03 17:25:38

On Thu, May 03, 2007 at 11:17:26AM -0500, Jon Loeliger wrote:
On Thu, 2007-05-03 at 11:10, Olof Johansson wrote:
quoted
This sounds like something that firmware should take care of, not
hardcoded in the board code.  Seems like the device is just a PCI device
that doesn't have a device tree entry.
Well, it's not a PCI device at all.
Really? You use a PCI quirk to manipulate it.
quoted
Why not do this in u-boot instead?
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.
The same argument could be used to motivate not doing any kind of board
inits in any firmware and do it all from the board code in linux.

Don't you guys use M1575 on other eval boards too, so you'll need the
same board quirk duplicated?


-Olof

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Olof Johansson <hidden>
Date: 2007-05-03 17:26:58

On Thu, May 03, 2007 at 11:19:21AM -0500, Kumar Gala wrote:
On May 3, 2007, at 11:17 AM, Jon Loeliger wrote:
quoted
quoted
Why not do this in u-boot instead?
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.
I agree with Jon here.  This is in board specific code so I don't see  
any issue with it.
Good to know. I'll keep that in mind myself for future reference, no
need to waste effort trying to get clean board ports.


-Olof

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Scott Wood <hidden>
Date: 2007-05-03 17:38:18

Olof Johansson wrote:
On Thu, May 03, 2007 at 11:17:26AM -0500, Jon Loeliger wrote:
quoted
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.
The same argument could be used to motivate not doing any kind of board
inits in any firmware and do it all from the board code in linux.
Not to mention that it's more likely that someone will use a different 
OS than different firmware, and then they'd have to duplicate the board 
code *there*.

-Scott

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Matt Sealey <hidden>
Date: 2007-05-06 22:41:56

Jon Loeliger wrote:
On Thu, 2007-05-03 at 11:10, Olof Johansson wrote:
quoted
This sounds like something that firmware should take care of, not
hardcoded in the board code.  Seems like the device is just a PCI device
that doesn't have a device tree entry.
Well, it's not a PCI device at all.
A PCI Express southbridge - not much difference really is there?
quoted
Why not do this in u-boot instead?
Why do it there?  We'd have to do it _again_ in Linux
if we didn't come in from U-Boot anyway.
Because the firmware should configure the board specifics if possible,
Linux should only be tweaking Northbridge/Southbridge settings if it
is truly configurable at runtime or boot. If the difference is between
whether an AC97 or Azalia codec is installed and soldered to the board,
and it is not possible to have both, really the firmware should be
setting up the chip so that only one is obviously usable.

Ostensibly Linux and any drivers should be able to check which is
enabled on the board - one revision may have AC97 and one may have
Azalia HD audio. If this can be swapped by simply having each driver
check the enabled codec mode on init, and dropping out if not correct,
then it's starting to get to be Plug And Play.

The alternative is that every revision of the board has it Hardcoded
Into A Board Support Package, with different device trees and strange
quirks which may or may not be easily determined, cluttering Kconfigs
and so on.

In theory; the firmware should do it, and if not, it should be done
as early in Linux boot (platform init, device tree fixup) as possible.
That's how we agreed to do it on the Efika after much, much discussion
and argument :D

-- 
Matt Sealey [off-list ref]
Genesi, Manager, Developer Relations

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-09 16:14:19

On Thu, 2007-05-03 at 11:19, Kumar Gala wrote:
I agree with Jon here.  This is in board specific code so I don't see  
any issue with it.

Hi Kumar,

So, bottom line, will you pick this patch up and
pass it along to Paul?

Thanks,
jdl

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Kumar Gala <hidden>
Date: 2007-05-09 16:20:27

On May 9, 2007, at 11:14 AM, Jon Loeliger wrote:
On Thu, 2007-05-03 at 11:19, Kumar Gala wrote:
quoted
I agree with Jon here.  This is in board specific code so I don't see
any issue with it.

Hi Kumar,

So, bottom line, will you pick this patch up and
pass it along to Paul?
will do.

- k

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Kumar Gala <hidden>
Date: 2007-05-10 05:20:46

On Wed, 2 May 2007, Jon Loeliger wrote:
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are enabled at
the same time, In order to use AC97 interface, we need to disable the HD
interface first.

Signed-off-by:Jason Jin[off-list ref]
Acked-by: Jon Loeliger <redacted>
---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
applied.

- k

Re: [PATCH] 86xx: Enable the AC97 interface on 8641D board.

From: Jon Loeliger <hidden>
Date: 2007-05-10 15:46:03

On Thu, 2007-05-10 at 00:16, Kumar Gala wrote:
On Wed, 2 May 2007, Jon Loeliger wrote:
quoted
From: Jason Jin <redacted>

HD interface and AC97 interface share some pins and they are enabled at
the same time, In order to use AC97 interface, we need to disable the HD
interface first.
applied.

- k
Thank you!

jdl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help