All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@rainbow-software.org (Ondrej Zary)
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matthew Wilcox <matthew@wil.cx>,
	Jean Delvare <khali@linux-fr.org>,
	Enrico Bartky <DOSProfi@web.de>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	LM Sensors <sensors@stimpy.netroedge.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Maarten Deprez <maartendeprez@scarlet.be>,
	Greg KH <gregkh@suse.de>
Subject: M7101
Date: Thu, 19 May 2005 06:25:37 +0000	[thread overview]
Message-ID: <4209237C.4020901@rainbow-software.org> (raw)
In-Reply-To: <20050208141322.A2831@jurassic.park.msu.ru>

Ivan Kokshaysky wrote:
> On Sun, Feb 06, 2005 at 03:06:11PM +0000, Matthew Wilcox wrote:
> 
>>Looks pretty good to me.  For clarity, I'd change:
>>
>>-	m7101 = pci_scan_single_device(dev->bus, 0x18);
>>+	m7101 = pci_scan_single_device(dev->bus, PCI_DEVFN(3, 0));
> 
> 
> No, it's pretty broken regardless of the change. The integrated devices
> on ALi southbridges (IDE, PMU, USB etc.) have programmable IDSELs,
> so using hardcoded devfn is just dangerous. We must figure out what
> the device number PMU will have before we turn it on.
> Something like this:
> 
> 	// NOTE: These values are for m1543. Someone must verify whether
> 	// they are the same for m1533 or not.
> 	static char pmu_idsels[4] __devinitdata = { 28, 29, 14, 15 };
> 
> 	...
> 
> 	/* Get IDSEL mapping for PMU (bits 2-3 of 0x72). */
> 	pci_read_config_byte(dev, 0x72, &val);
> 	devnum = pmu_idsel[(val >> 2) & 3] - 11;
> 	m7101 = pci_get_slot(dev->bus, PCI_DEVFN(devnum, 0));
> 	if (m7101) {
> 		/* Failure - there is another device with the same number. */
> 		pci_dev_put(m7101);
> 		return;
> 	}
> 
> 	/* Enable PMU. */
> 	...
> 
> 	m7101 = pci_scan_single_device(dev->bus, PCI_DEVFN(devnum, 0));
> 	...

In fact, the patch is completely wrong for M1533 south bridge, it will 
work only with M1543.
M1533 has different PCI config. register layout - the bit 2 of 0x5F 
register is not used for enabling/disabling M7101 but for "on-chip 
arbiter control". M7101 can be enabled/disabled using bit 6 of 0x5D 
register... M1533 has also different M7101 registers.
The best thing about this is that these two M7101s have the same PCI 
device IDs (0x7101).
The south bridges have the same PCI IDs too (0x1533 used by both M1533 
and M1543). But according to the datasheet, M1543 should have revision 
number at least 0xC0.

-- 
Ondrej Zary

WARNING: multiple messages have this Message-ID (diff)
From: Ondrej Zary <linux@rainbow-software.org>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matthew Wilcox <matthew@wil.cx>,
	Jean Delvare <khali@linux-fr.org>,
	Enrico Bartky <DOSProfi@web.de>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	LM Sensors <sensors@stimpy.netroedge.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Maarten Deprez <maartendeprez@scarlet.be>,
	Greg KH <gregkh@suse.de>
Subject: Re: M7101
Date: Tue, 08 Feb 2005 21:39:24 +0100	[thread overview]
Message-ID: <4209237C.4020901@rainbow-software.org> (raw)
In-Reply-To: <20050208141322.A2831@jurassic.park.msu.ru>

Ivan Kokshaysky wrote:
> On Sun, Feb 06, 2005 at 03:06:11PM +0000, Matthew Wilcox wrote:
> 
>>Looks pretty good to me.  For clarity, I'd change:
>>
>>-	m7101 = pci_scan_single_device(dev->bus, 0x18);
>>+	m7101 = pci_scan_single_device(dev->bus, PCI_DEVFN(3, 0));
> 
> 
> No, it's pretty broken regardless of the change. The integrated devices
> on ALi southbridges (IDE, PMU, USB etc.) have programmable IDSELs,
> so using hardcoded devfn is just dangerous. We must figure out what
> the device number PMU will have before we turn it on.
> Something like this:
> 
> 	// NOTE: These values are for m1543. Someone must verify whether
> 	// they are the same for m1533 or not.
> 	static char pmu_idsels[4] __devinitdata = { 28, 29, 14, 15 };
> 
> 	...
> 
> 	/* Get IDSEL mapping for PMU (bits 2-3 of 0x72). */
> 	pci_read_config_byte(dev, 0x72, &val);
> 	devnum = pmu_idsel[(val >> 2) & 3] - 11;
> 	m7101 = pci_get_slot(dev->bus, PCI_DEVFN(devnum, 0));
> 	if (m7101) {
> 		/* Failure - there is another device with the same number. */
> 		pci_dev_put(m7101);
> 		return;
> 	}
> 
> 	/* Enable PMU. */
> 	...
> 
> 	m7101 = pci_scan_single_device(dev->bus, PCI_DEVFN(devnum, 0));
> 	...

In fact, the patch is completely wrong for M1533 south bridge, it will 
work only with M1543.
M1533 has different PCI config. register layout - the bit 2 of 0x5F 
register is not used for enabling/disabling M7101 but for "on-chip 
arbiter control". M7101 can be enabled/disabled using bit 6 of 0x5D 
register... M1533 has also different M7101 registers.
The best thing about this is that these two M7101s have the same PCI 
device IDs (0x7101).
The south bridges have the same PCI IDs too (0x1533 used by both M1533 
and M1543). But according to the datasheet, M1543 should have revision 
number at least 0xC0.

-- 
Ondrej Zary

  reply	other threads:[~2005-05-19  6:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 21:18 M7101 Enrico Bartky
2005-05-19  6:25 ` M7101 Enrico Bartky
2005-02-06 14:26 ` M7101 Jean Delvare
2005-05-19  6:25   ` M7101 Jean Delvare
2005-02-06 15:06   ` M7101 Matthew Wilcox
2005-05-19  6:25     ` M7101 Matthew Wilcox
2005-02-08 11:13     ` M7101 Ivan Kokshaysky
2005-05-19  6:25       ` M7101 Ivan Kokshaysky
2005-02-08 20:39       ` Ondrej Zary [this message]
2005-05-19  6:25         ` M7101 Ondrej Zary
2005-02-07  3:42   ` M7101 Grant Grundler
2005-05-19  6:25     ` M7101 Grant Grundler
2005-02-12 18:52     ` M7101 Jean Delvare
2005-05-19  6:25       ` M7101 Jean Delvare
2005-02-07 20:43   ` M7101 Greg KH
2005-05-19  6:25     ` M7101 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4209237C.4020901@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=DOSProfi@web.de \
    --cc=gregkh@suse.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=maartendeprez@scarlet.be \
    --cc=matthew@wil.cx \
    --cc=sensors@stimpy.netroedge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.