@@ -26,13 +26,16 @@ enum bcm4377_chip {
26
26
BCM4377 = 0 ,
27
27
BCM4378 ,
28
28
BCM4387 ,
29
+ BCM4388 ,
29
30
};
30
31
31
32
#define BCM4377_DEVICE_ID 0x5fa0
32
33
#define BCM4378_DEVICE_ID 0x5f69
33
34
#define BCM4387_DEVICE_ID 0x5f71
35
+ #define BCM4388_DEVICE_ID 0x5f72
34
36
35
- #define BCM4377_TIMEOUT 1000
37
+ #define BCM4377_TIMEOUT msecs_to_jiffies(1000)
38
+ #define BCM4377_BOOT_TIMEOUT msecs_to_jiffies(5000)
36
39
37
40
/*
38
41
* These devices only support DMA transactions inside a 32bit window
@@ -506,6 +509,7 @@ struct bcm4377_hw {
506
509
u32 bar0_window1 ;
507
510
u32 bar0_window2 ;
508
511
u32 bar0_core2_window2 ;
512
+ u32 bar2_offset ;
509
513
510
514
unsigned long has_bar0_core2_window2 : 1 ;
511
515
unsigned long clear_pciecfg_subsystem_ctrl_bit19 : 1 ;
@@ -716,7 +720,7 @@ static void bcm4377_handle_ack(struct bcm4377_data *bcm4377,
716
720
ring -> events [msgid ] = NULL ;
717
721
}
718
722
719
- bitmap_release_region (ring -> msgids , msgid , ring -> n_entries );
723
+ bitmap_release_region (ring -> msgids , msgid , 0 );
720
724
721
725
unlock :
722
726
spin_unlock_irqrestore (& ring -> lock , flags );
@@ -830,8 +834,8 @@ static irqreturn_t bcm4377_irq(int irq, void *data)
830
834
struct bcm4377_data * bcm4377 = data ;
831
835
u32 bootstage , rti_status ;
832
836
833
- bootstage = ioread32 (bcm4377 -> bar2 + BCM4377_BAR2_BOOTSTAGE );
834
- rti_status = ioread32 (bcm4377 -> bar2 + BCM4377_BAR2_RTI_STATUS );
837
+ bootstage = ioread32 (bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_BOOTSTAGE );
838
+ rti_status = ioread32 (bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_RTI_STATUS );
835
839
836
840
if (bootstage != bcm4377 -> bootstage ||
837
841
rti_status != bcm4377 -> rti_status ) {
@@ -1191,6 +1195,14 @@ static int bcm4387_send_calibration(struct bcm4377_data *bcm4377)
1191
1195
bcm4377 -> taurus_cal_size );
1192
1196
}
1193
1197
1198
+ static int bcm4388_send_calibration (struct bcm4377_data * bcm4377 )
1199
+ {
1200
+ /* Guess that these always use beamforming */
1201
+ return __bcm4378_send_calibration (
1202
+ bcm4377 , bcm4377 -> taurus_beamforming_cal_blob ,
1203
+ bcm4377 -> taurus_beamforming_cal_size );
1204
+ }
1205
+
1194
1206
static const struct firmware * bcm4377_request_blob (struct bcm4377_data * bcm4377 ,
1195
1207
const char * suffix )
1196
1208
{
@@ -1814,8 +1826,8 @@ static int bcm4377_boot(struct bcm4377_data *bcm4377)
1814
1826
int ret = 0 ;
1815
1827
u32 bootstage , rti_status ;
1816
1828
1817
- bootstage = ioread32 (bcm4377 -> bar2 + BCM4377_BAR2_BOOTSTAGE );
1818
- rti_status = ioread32 (bcm4377 -> bar2 + BCM4377_BAR2_RTI_STATUS );
1829
+ bootstage = ioread32 (bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_BOOTSTAGE );
1830
+ rti_status = ioread32 (bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_RTI_STATUS );
1819
1831
1820
1832
if (bootstage != 0 ) {
1821
1833
dev_err (& bcm4377 -> pdev -> dev , "bootstage is %d and not 0\n" ,
@@ -1849,15 +1861,18 @@ static int bcm4377_boot(struct bcm4377_data *bcm4377)
1849
1861
iowrite32 (BCM4377_DMA_MASK ,
1850
1862
bcm4377 -> bar0 + BCM4377_BAR0_HOST_WINDOW_SIZE );
1851
1863
1852
- iowrite32 (lower_32_bits (fw_dma ), bcm4377 -> bar2 + BCM4377_BAR2_FW_LO );
1853
- iowrite32 (upper_32_bits (fw_dma ), bcm4377 -> bar2 + BCM4377_BAR2_FW_HI );
1854
- iowrite32 (fw -> size , bcm4377 -> bar2 + BCM4377_BAR2_FW_SIZE );
1864
+ iowrite32 (lower_32_bits (fw_dma ),
1865
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_FW_LO );
1866
+ iowrite32 (upper_32_bits (fw_dma ),
1867
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_FW_HI );
1868
+ iowrite32 (fw -> size ,
1869
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_FW_SIZE );
1855
1870
iowrite32 (0 , bcm4377 -> bar0 + BCM4377_BAR0_FW_DOORBELL );
1856
1871
1857
1872
dev_dbg (& bcm4377 -> pdev -> dev , "waiting for firmware to boot\n" );
1858
1873
1859
1874
ret = wait_for_completion_interruptible_timeout (& bcm4377 -> event ,
1860
- BCM4377_TIMEOUT );
1875
+ BCM4377_BOOT_TIMEOUT );
1861
1876
if (ret == 0 ) {
1862
1877
ret = - ETIMEDOUT ;
1863
1878
goto out_dma_free ;
@@ -1908,16 +1923,16 @@ static int bcm4377_setup_rti(struct bcm4377_data *bcm4377)
1908
1923
dev_dbg (& bcm4377 -> pdev -> dev , "RTI is in state 1\n" );
1909
1924
1910
1925
/* allow access to the entire IOVA space again */
1911
- iowrite32 (0 , bcm4377 -> bar2 + BCM4377_BAR2_RTI_WINDOW_LO );
1912
- iowrite32 (0 , bcm4377 -> bar2 + BCM4377_BAR2_RTI_WINDOW_HI );
1926
+ iowrite32 (0 , bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_RTI_WINDOW_LO );
1927
+ iowrite32 (0 , bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_RTI_WINDOW_HI );
1913
1928
iowrite32 (BCM4377_DMA_MASK ,
1914
- bcm4377 -> bar2 + BCM4377_BAR2_RTI_WINDOW_SIZE );
1929
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_RTI_WINDOW_SIZE );
1915
1930
1916
1931
/* setup "Converged IPC" context */
1917
1932
iowrite32 (lower_32_bits (bcm4377 -> ctx_dma ),
1918
- bcm4377 -> bar2 + BCM4377_BAR2_CONTEXT_ADDR_LO );
1933
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_CONTEXT_ADDR_LO );
1919
1934
iowrite32 (upper_32_bits (bcm4377 -> ctx_dma ),
1920
- bcm4377 -> bar2 + BCM4377_BAR2_CONTEXT_ADDR_HI );
1935
+ bcm4377 -> bar2 + bcm4377 -> hw -> bar2_offset + BCM4377_BAR2_CONTEXT_ADDR_HI );
1921
1936
iowrite32 (2 , bcm4377 -> bar0 + BCM4377_BAR0_RTI_CONTROL );
1922
1937
1923
1938
ret = wait_for_completion_interruptible_timeout (& bcm4377 -> event ,
@@ -2481,6 +2496,20 @@ static const struct bcm4377_hw bcm4377_hw_variants[] = {
2481
2496
.send_calibration = bcm4387_send_calibration ,
2482
2497
.send_ptb = bcm4378_send_ptb ,
2483
2498
},
2499
+
2500
+ [BCM4388 ] = {
2501
+ .id = 0x4388 ,
2502
+ .otp_offset = 0x415c ,
2503
+ .bar2_offset = 0x200000 ,
2504
+ .bar0_window1 = 0x18002000 ,
2505
+ .bar0_window2 = 0x18109000 ,
2506
+ .bar0_core2_window2 = 0x18106000 ,
2507
+ .has_bar0_core2_window2 = true,
2508
+ .broken_mws_transport_config = true,
2509
+ .broken_le_coded = true,
2510
+ .send_calibration = bcm4388_send_calibration ,
2511
+ .send_ptb = bcm4378_send_ptb ,
2512
+ },
2484
2513
};
2485
2514
2486
2515
#define BCM4377_DEVID_ENTRY (id ) \
@@ -2494,6 +2523,7 @@ static const struct pci_device_id bcm4377_devid_table[] = {
2494
2523
BCM4377_DEVID_ENTRY (4377 ),
2495
2524
BCM4377_DEVID_ENTRY (4378 ),
2496
2525
BCM4377_DEVID_ENTRY (4387 ),
2526
+ BCM4377_DEVID_ENTRY (4388 ),
2497
2527
{},
2498
2528
};
2499
2529
MODULE_DEVICE_TABLE (pci , bcm4377_devid_table );
0 commit comments