Patchwork fixup! Remove potential endless loops from satasii.c.

login
register
about
Submitter Stefan Tauner
Date 2012-08-25 02:20:11
Message ID <1345861211-29427-1-git-send-email-stefan.tauner@student.tuwien.ac.at>
Download mbox | patch
Permalink /patch/3721/
State RFC
Headers show

Comments

Stefan Tauner - 2012-08-25 02:20:11
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
---
i have not looked at the datasheet... do we still want this in?
then ill commit it with the previous patch... or my tested stuff branch?
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
---
 satasii.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/satasii.c b/satasii.c
index a68a0c4..18003b8 100644
--- a/satasii.c
+++ b/satasii.c
@@ -79,6 +79,7 @@  int satasii_init(void)
 {
 	uint32_t addr;
 	uint16_t reg_offset;
+	uint32_t tmp;
 
 	if (rget_io_perms())
 		return 1;
@@ -101,6 +102,13 @@  int satasii_init(void)
 	if ((id != 0x0680) && (!(pci_mmio_readl(sii_bar) & (1 << 26))))
 		msg_pinfo("Warning: Flash seems unconnected.\n");
 
+	msg_pdbg("Using BAR5 access method.\n");
+	tmp = pci_read_long(pcidev_dev, 0x40) & (1 << 1);
+	msg_pdbg("BAR5 Indirect Access is %sabled\n", tmp ? "en" : "dis");
+	/* This bit has contradicting definitions in the 3512 datasheet. */
+	tmp = pci_read_long(pcidev_dev, 0x88) & (1 << 16);
+	msg_pdbg("BAR5 Access is %sabled\n", tmp ? "en" : "dis");
+
 	if (register_shutdown(satasii_shutdown, NULL))
 		return 1;