Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90e569d1 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville
Browse files

b43: N-PHY: optimize init by doing some ops just once

parent 09951ad4
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -700,13 +700,11 @@ static void b43_radio_2057_init_post(struct b43_wldev *dev)
	b43_radio_mask(dev, R2057_RFPLL_MISC_CAL_RESETN, ~0x78);
	b43_radio_mask(dev, R2057_XTAL_CONFIG2, ~0x80);

	if (dev->phy.n->init_por) {
	if (dev->phy.do_full_init) {
		b43_radio_2057_rcal(dev);
		b43_radio_2057_rccal(dev);
	}
	b43_radio_mask(dev, R2057_RFPLL_MASTER, ~0x8);

	dev->phy.n->init_por = false;
}

/* http://bcm-v4.sipsolutions.net/802.11/Radio/2057/Init */
@@ -1028,7 +1026,7 @@ static void b43_radio_init2056_post(struct b43_wldev *dev)
	b43_radio_mask(dev, B2056_SYN_COM_RESET, ~0x2);
	b43_radio_mask(dev, B2056_SYN_PLL_MAST2, ~0xFC);
	b43_radio_mask(dev, B2056_SYN_RCCAL_CTRL0, ~0x1);
	if (dev->phy.n->init_por)
	if (dev->phy.do_full_init)
		b43_radio_2056_rcal(dev);
}

@@ -1041,8 +1039,6 @@ static void b43_radio_init2056(struct b43_wldev *dev)
	b43_radio_init2056_pre(dev);
	b2056_upload_inittabs(dev, 0, 0);
	b43_radio_init2056_post(dev);

	dev->phy.n->init_por = false;
}

/**************************************************
@@ -5561,7 +5557,6 @@ static void b43_nphy_op_prepare_structs(struct b43_wldev *dev)
	nphy->hang_avoid = (phy->rev == 3 || phy->rev == 4);
	nphy->spur_avoid = (phy->rev >= 3) ?
				B43_SPUR_AVOID_AUTO : B43_SPUR_AVOID_DISABLE;
	nphy->init_por = true;
	nphy->gain_boost = true; /* this way we follow wl, assume it is true */
	nphy->txrx_chain = 2; /* sth different than 0 and 1 for now */
	nphy->phyrxchain = 3; /* to avoid b43_nphy_set_rx_core_state like wl */
@@ -5602,8 +5597,6 @@ static void b43_nphy_op_prepare_structs(struct b43_wldev *dev)
		nphy->ipa2g_on = sprom->fem.ghz2.extpa_gain == 2;
		nphy->ipa5g_on = sprom->fem.ghz5.extpa_gain == 2;
	}

	nphy->init_por = true;
}

static void b43_nphy_op_free(struct b43_wldev *dev)
+0 −1
Original line number Diff line number Diff line
@@ -931,7 +931,6 @@ struct b43_phy_n {
	u16 papd_epsilon_offset[2];
	s32 preamble_override;
	u32 bb_mult_save;
	bool init_por;

	bool gain_boost;
	bool elna_gain_config;
+42 −38
Original line number Diff line number Diff line
@@ -3042,6 +3042,7 @@ static void b43_nphy_tables_init_rev3(struct b43_wldev *dev)
		antswlut = sprom->fem.ghz2.antswlut;

	/* Static tables */
	if (dev->phy.do_full_init) {
		ntab_upload(dev, B43_NTAB_FRAMESTRUCT_R3, b43_ntab_framestruct_r3);
		ntab_upload(dev, B43_NTAB_PILOT_R3, b43_ntab_pilot_r3);
		ntab_upload(dev, B43_NTAB_TMAP_R3, b43_ntab_tmap_r3);
@@ -3066,6 +3067,7 @@ static void b43_nphy_tables_init_rev3(struct b43_wldev *dev)
		ntab_upload(dev, B43_NTAB_C1_IQLT_R3, b43_ntab_iqlt1_r3);
		ntab_upload(dev, B43_NTAB_C0_LOFEEDTH_R3, b43_ntab_loftlt0_r3);
		ntab_upload(dev, B43_NTAB_C1_LOFEEDTH_R3, b43_ntab_loftlt1_r3);
	}

	/* Volatile tables */
	if (antswlut < ARRAY_SIZE(b43_ntab_antswctl_r3))
@@ -3078,6 +3080,7 @@ static void b43_nphy_tables_init_rev3(struct b43_wldev *dev)
static void b43_nphy_tables_init_rev0(struct b43_wldev *dev)
{
	/* Static tables */
	if (dev->phy.do_full_init) {
		ntab_upload(dev, B43_NTAB_FRAMESTRUCT, b43_ntab_framestruct);
		ntab_upload(dev, B43_NTAB_FRAMELT, b43_ntab_framelookup);
		ntab_upload(dev, B43_NTAB_TMAP, b43_ntab_tmap);
@@ -3092,6 +3095,7 @@ static void b43_nphy_tables_init_rev0(struct b43_wldev *dev)
		ntab_upload(dev, B43_NTAB_MCS, b43_ntab_mcs);
		ntab_upload(dev, B43_NTAB_NOISEVAR10, b43_ntab_noisevar10);
		ntab_upload(dev, B43_NTAB_NOISEVAR11, b43_ntab_noisevar11);
	}

	/* Volatile tables */
	ntab_upload(dev, B43_NTAB_BDI, b43_ntab_bdi);