svn commit: r299541 - head/sys/dev/siba

Adrian Chadd adrian at FreeBSD.org
Thu May 12 16:14:18 UTC 2016


Author: adrian
Date: Thu May 12 16:14:16 2016
New Revision: 299541
URL: https://svnweb.freebsd.org/changeset/base/299541

Log:
  [siba] add more MCS tx power offset decoding.
  
  This is required by the bwn(4) N-PHY support.
  
  Obtained from:	Linux ssb (definitions)

Modified:
  head/sys/dev/siba/siba_core.c
  head/sys/dev/siba/sibareg.h
  head/sys/dev/siba/sibavar.h

Modified: head/sys/dev/siba/siba_core.c
==============================================================================
--- head/sys/dev/siba/siba_core.c	Thu May 12 16:07:25 2016	(r299540)
+++ head/sys/dev/siba/siba_core.c	Thu May 12 16:14:16 2016	(r299541)
@@ -1834,6 +1834,9 @@ siba_sprom_r8(struct siba_sprom *out, co
 		SIBA_SHIFTOUT(core_pwr_info[i].pa_5gh[2], o + SIBA_SROM8_5GH_PA_2, ~0);
 	}
 
+	SIBA_SHIFTOUT(cddpo, SIBA_SPROM8_CDDPO, ~0);
+	SIBA_SHIFTOUT(stbcpo, SIBA_SPROM8_STBCPO, ~0);
+
 	siba_sprom_r458(out, in);
 }
 
@@ -2562,6 +2565,12 @@ siba_read_sprom(device_t dev, device_t c
 	case SIBA_SPROMVAR_TXPID_5GH_3:
 		*result = siba->siba_sprom.txpid5gh[3];
 		break;
+	case SIBA_SPROMVAR_STBCPO:
+		*result = siba->siba_sprom.stbcpo;
+		break;
+	case SIBA_SPROMVAR_CDDPO:
+		*result = siba->siba_sprom.cddpo;
+		break;
 	default:
 		return (ENOENT);
 	}
@@ -2814,6 +2823,46 @@ siba_sprom_get_core_power_info(device_t 
 	return (0);
 }
 
+int
+siba_sprom_get_mcs2gpo(device_t dev, uint16_t *c)
+{
+	struct siba_dev_softc *sd = device_get_ivars(dev);
+	struct siba_softc *siba = sd->sd_bus;
+
+	memcpy(c, &siba->siba_sprom.mcs2gpo, sizeof(uint16_t) * 8);
+	return (0);
+}
+
+int
+siba_sprom_get_mcs5glpo(device_t dev, uint16_t *c)
+{
+	struct siba_dev_softc *sd = device_get_ivars(dev);
+	struct siba_softc *siba = sd->sd_bus;
+
+	memcpy(c, &siba->siba_sprom.mcs5glpo, sizeof(uint16_t) * 8);
+	return (0);
+}
+
+int
+siba_sprom_get_mcs5gpo(device_t dev, uint16_t *c)
+{
+	struct siba_dev_softc *sd = device_get_ivars(dev);
+	struct siba_softc *siba = sd->sd_bus;
+
+	memcpy(c, &siba->siba_sprom.mcs5gpo, sizeof(uint16_t) * 8);
+	return (0);
+}
+
+int
+siba_sprom_get_mcs5ghpo(device_t dev, uint16_t *c)
+{
+	struct siba_dev_softc *sd = device_get_ivars(dev);
+	struct siba_softc *siba = sd->sd_bus;
+
+	memcpy(c, &siba->siba_sprom.mcs5ghpo, sizeof(uint16_t) * 8);
+	return (0);
+}
+
 void
 siba_pmu_spuravoid_pllupdate(device_t dev, int spur_avoid)
 {

Modified: head/sys/dev/siba/sibareg.h
==============================================================================
--- head/sys/dev/siba/sibareg.h	Thu May 12 16:07:25 2016	(r299540)
+++ head/sys/dev/siba/sibareg.h	Thu May 12 16:14:16 2016	(r299541)
@@ -520,6 +520,10 @@
 #define	SIBA_SPROM8_OFDM5GPO		0x1146
 #define	SIBA_SPROM8_OFDM5GLPO		0x114a
 #define	SIBA_SPROM8_OFDM5GHPO		0x114e
+#define	SIBA_SPROM8_CDDPO		0x0192
+#define	SIBA_SPROM8_STBCPO		0x0194
+#define	SIBA_SPROM8_BW40PO		0x0196
+#define	SIBA_SPROM8_BWDUPPO		0x0198
 
 /* There are 4 blocks with power info sharing the same layout */
 #define	SIBA_SROM8_PWR_INFO_CORE0	0x00C0

Modified: head/sys/dev/siba/sibavar.h
==============================================================================
--- head/sys/dev/siba/sibavar.h	Thu May 12 16:07:25 2016	(r299540)
+++ head/sys/dev/siba/sibavar.h	Thu May 12 16:14:16 2016	(r299541)
@@ -305,6 +305,8 @@ enum siba_sprom_vars {
 	SIBA_SPROMVAR_TXPID_5GH_1,
 	SIBA_SPROMVAR_TXPID_5GH_2,
 	SIBA_SPROMVAR_TXPID_5GH_3,
+	SIBA_SPROMVAR_STBCPO,
+	SIBA_SPROMVAR_CDDPO,
 };
 
 int		siba_read_sprom(device_t, device_t, int, uintptr_t *);
@@ -419,6 +421,8 @@ SIBA_SPROM_ACCESSOR(txpid_5gh_0, TXPID_5
 SIBA_SPROM_ACCESSOR(txpid_5gh_1, TXPID_5GH_1, uint8_t);
 SIBA_SPROM_ACCESSOR(txpid_5gh_2, TXPID_5GH_2, uint8_t);
 SIBA_SPROM_ACCESSOR(txpid_5gh_3, TXPID_5GH_3, uint8_t);
+SIBA_SPROM_ACCESSOR(stbcpo, STBCPO, uint16_t);
+SIBA_SPROM_ACCESSOR(cddpo, CDDPO, uint16_t);
 
 #undef SIBA_SPROM_ACCESSOR
 
@@ -512,6 +516,14 @@ struct siba_sprom {
 			uint8_t antswlut;
 		} ghz5;
 	} fem;
+
+	uint16_t mcs2gpo[8];
+	uint16_t mcs5gpo[8];
+	uint16_t mcs5glpo[8];
+	uint16_t mcs5ghpo[8];
+
+	uint16_t cddpo;
+	uint16_t stbcpo;
 };
 
 #define	SIBA_LDO_PAREF			0
@@ -648,6 +660,10 @@ uint32_t	siba_gpio_get(device_t);
 void		siba_fix_imcfglobug(device_t);
 int		siba_sprom_get_core_power_info(device_t, int,
 		    struct siba_sprom_core_pwr_info *);
+int		siba_sprom_get_mcs2gpo(device_t, uint16_t *);
+int		siba_sprom_get_mcs5glpo(device_t, uint16_t *);
+int		siba_sprom_get_mcs5gpo(device_t, uint16_t *);
+int		siba_sprom_get_mcs5ghpo(device_t, uint16_t *);
 void		siba_pmu_spuravoid_pllupdate(device_t, int);
 void		siba_cc_set32(device_t dev, uint32_t, uint32_t);
 void		siba_cc_mask32(device_t dev, uint32_t, uint32_t);


More information about the svn-src-head mailing list