mirror of
https://github.com/open-sdr/openwifi.git
synced 2024-12-19 05:38:09 +00:00
add recent update:
1. add git revision software register 7 to DRV_XPU module (not FPGA XPU module) 2. fix the print of hdr->seq_ctrl in sdr.c 3. add ht_flag display to sdr.c 4. remove the sysid from devicetree because new we have our own git revision read back solution in FPGA (XPU register 63) and driver (the sotware register 7 of drv_xpu) 5. add sudo to update_sdcard.sh to make the image generation without SD card in the test-bed easier
This commit is contained in:
parent
3efa6c7775
commit
0a92505df2
@ -53,6 +53,7 @@ set -x
|
|||||||
home_dir=$(pwd)
|
home_dir=$(pwd)
|
||||||
|
|
||||||
cd $OPENWIFI_DIR/driver/
|
cd $OPENWIFI_DIR/driver/
|
||||||
|
echo "#define GIT_REV 0x"$(git log -1 --pretty=%h) > git_rev.h
|
||||||
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
||||||
cd $OPENWIFI_DIR/driver/openofdm_tx
|
cd $OPENWIFI_DIR/driver/openofdm_tx
|
||||||
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE
|
||||||
|
36
driver/sdr.c
36
driver/sdr.c
@ -52,6 +52,7 @@
|
|||||||
#include "../user_space/sdrctl_src/nl80211_testmode_def.h"
|
#include "../user_space/sdrctl_src/nl80211_testmode_def.h"
|
||||||
#include "hw_def.h"
|
#include "hw_def.h"
|
||||||
#include "sdr.h"
|
#include "sdr.h"
|
||||||
|
#include "git_rev.h"
|
||||||
|
|
||||||
// driver API of component driver
|
// driver API of component driver
|
||||||
extern struct tx_intf_driver_api *tx_intf_api;
|
extern struct tx_intf_driver_api *tx_intf_api;
|
||||||
@ -312,7 +313,7 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id)
|
|||||||
struct ieee80211_rx_status rx_status = {0};
|
struct ieee80211_rx_status rx_status = {0};
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct ieee80211_hdr *hdr;
|
struct ieee80211_hdr *hdr;
|
||||||
u32 addr1_low32=0, addr2_low32=0, addr3_low32=0, len, rate_idx, tsft_low, tsft_high, loop_count=0;//, ht_flag//;//, fc_di;
|
u32 addr1_low32=0, addr2_low32=0, addr3_low32=0, len, rate_idx, tsft_low, tsft_high, loop_count=0, ht_flag;//;//, fc_di;
|
||||||
// u32 dma_driver_buf_idx_mod;
|
// u32 dma_driver_buf_idx_mod;
|
||||||
u8 *pdata_tmp, fcs_ok, target_buf_idx;//, phy_rx_sn_hw;
|
u8 *pdata_tmp, fcs_ok, target_buf_idx;//, phy_rx_sn_hw;
|
||||||
s8 signal;
|
s8 signal;
|
||||||
@ -343,7 +344,7 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id)
|
|||||||
// phy_rx_sn_hw = (fcs_ok&0x7f);//0x7f is FPGA limitation
|
// phy_rx_sn_hw = (fcs_ok&0x7f);//0x7f is FPGA limitation
|
||||||
// dma_driver_buf_idx_mod = (state.residue&0x7f);
|
// dma_driver_buf_idx_mod = (state.residue&0x7f);
|
||||||
fcs_ok = ((fcs_ok&0x80)!=0);
|
fcs_ok = ((fcs_ok&0x80)!=0);
|
||||||
// ht_flag = ((rate_idx&0x10)!=0);
|
ht_flag = ((rate_idx&0x10)!=0);
|
||||||
rate_idx = (rate_idx&0xF);
|
rate_idx = (rate_idx&0xF);
|
||||||
|
|
||||||
if ( (len>=14 && (!len_overflow)) && (rate_idx>=8 && rate_idx<=15)) {
|
if ( (len>=14 && (!len_overflow)) && (rate_idx>=8 && rate_idx<=15)) {
|
||||||
@ -385,8 +386,8 @@ static irqreturn_t openwifi_rx_interrupt(int irq, void *dev_id)
|
|||||||
sc = hdr->seq_ctrl;
|
sc = hdr->seq_ctrl;
|
||||||
|
|
||||||
if ( addr1_low32!=0xffffffff || addr1_high16!=0xffff )
|
if ( addr1_low32!=0xffffffff || addr1_high16!=0xffff )
|
||||||
printk("%s openwifi_rx_interrupt:%4dbytes %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x fcs%d buf_idx%d %ddBm\n", sdr_compatible_str,
|
printk("%s openwifi_rx_interrupt:%4dbytes ht%d %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x fcs%d buf_idx%d %ddBm\n", sdr_compatible_str,
|
||||||
len, wifi_rate_table[rate_idx], hdr->frame_control, hdr->duration_id,
|
len, ht_flag, wifi_rate_table[rate_idx], hdr->frame_control, hdr->duration_id,
|
||||||
reverse16(addr1_high16), reverse32(addr1_low32), reverse16(addr2_high16), reverse32(addr2_low32), reverse16(addr3_high16), reverse32(addr3_low32),
|
reverse16(addr1_high16), reverse32(addr1_low32), reverse16(addr2_high16), reverse32(addr2_low32), reverse16(addr3_high16), reverse32(addr3_low32),
|
||||||
sc, fcs_ok, target_buf_idx_old, signal);
|
sc, fcs_ok, target_buf_idx_old, signal);
|
||||||
}
|
}
|
||||||
@ -640,8 +641,6 @@ static void openwifi_tx(struct ieee80211_hw *dev,
|
|||||||
addr3_low32 = *((u32*)(hdr->addr3+2));
|
addr3_low32 = *((u32*)(hdr->addr3+2));
|
||||||
addr3_high16 = *((u16*)(hdr->addr3));
|
addr3_high16 = *((u16*)(hdr->addr3));
|
||||||
}
|
}
|
||||||
if (len_mac_pdu>=28)
|
|
||||||
sc = hdr->seq_ctrl;
|
|
||||||
|
|
||||||
duration_id = hdr->duration_id;
|
duration_id = hdr->duration_id;
|
||||||
frame_control=hdr->frame_control;
|
frame_control=hdr->frame_control;
|
||||||
@ -687,6 +686,20 @@ static void openwifi_tx(struct ieee80211_hw *dev,
|
|||||||
cts_duration = traffic_pkt_duration + sifs + pkt_need_ack*(sifs+ack_duration);
|
cts_duration = traffic_pkt_duration + sifs + pkt_need_ack*(sifs+ack_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is 11b stuff
|
||||||
|
// if (info->flags&IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
|
||||||
|
// printk("%s openwifi_tx: WARNING IEEE80211_TX_RC_USE_SHORT_PREAMBLE\n", sdr_compatible_str);
|
||||||
|
|
||||||
|
if (len_mac_pdu>=28) {
|
||||||
|
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
|
||||||
|
if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
|
||||||
|
priv->seqno += 0x10;
|
||||||
|
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
|
||||||
|
hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
|
||||||
|
}
|
||||||
|
sc = hdr->seq_ctrl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (!addr_flag) && (priv->drv_tx_reg_val[DRV_TX_REG_IDX_PRINT_CFG]&2) )
|
if ( (!addr_flag) && (priv->drv_tx_reg_val[DRV_TX_REG_IDX_PRINT_CFG]&2) )
|
||||||
printk("%s openwifi_tx: %4dbytes %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x flag%08x retr%d ack%d prio%d q%d wr%d rd%d\n", sdr_compatible_str,
|
printk("%s openwifi_tx: %4dbytes %2dM FC%04x DI%04x addr1/2/3:%04x%08x/%04x%08x/%04x%08x SC%04x flag%08x retr%d ack%d prio%d q%d wr%d rd%d\n", sdr_compatible_str,
|
||||||
len_mac_pdu, wifi_rate_all[rate_hw_value],frame_control,duration_id,
|
len_mac_pdu, wifi_rate_all[rate_hw_value],frame_control,duration_id,
|
||||||
@ -701,16 +714,6 @@ static void openwifi_tx(struct ieee80211_hw *dev,
|
|||||||
// info->status.rates[2].idx,info->status.rates[2].count,info->status.rates[2].flags,
|
// info->status.rates[2].idx,info->status.rates[2].count,info->status.rates[2].flags,
|
||||||
// info->status.rates[3].idx,info->status.rates[3].count,info->status.rates[3].flags);
|
// info->status.rates[3].idx,info->status.rates[3].count,info->status.rates[3].flags);
|
||||||
|
|
||||||
// this is 11b stuff
|
|
||||||
// if (info->flags&IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
|
|
||||||
// printk("%s openwifi_tx: WARNING IEEE80211_TX_RC_USE_SHORT_PREAMBLE\n", sdr_compatible_str);
|
|
||||||
|
|
||||||
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
|
|
||||||
if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
|
|
||||||
priv->seqno += 0x10;
|
|
||||||
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
|
|
||||||
hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
|
|
||||||
}
|
|
||||||
// -----------end of preprocess some info from header and skb----------------
|
// -----------end of preprocess some info from header and skb----------------
|
||||||
|
|
||||||
// /* HW will perform RTS-CTS when only RTS flags is set.
|
// /* HW will perform RTS-CTS when only RTS flags is set.
|
||||||
@ -869,6 +872,7 @@ static int openwifi_start(struct ieee80211_hw *dev)
|
|||||||
memset(priv->drv_tx_reg_val, 0, sizeof(priv->drv_tx_reg_val));
|
memset(priv->drv_tx_reg_val, 0, sizeof(priv->drv_tx_reg_val));
|
||||||
memset(priv->drv_rx_reg_val, 0, sizeof(priv->drv_rx_reg_val));
|
memset(priv->drv_rx_reg_val, 0, sizeof(priv->drv_rx_reg_val));
|
||||||
memset(priv->drv_xpu_reg_val, 0, sizeof(priv->drv_xpu_reg_val));
|
memset(priv->drv_xpu_reg_val, 0, sizeof(priv->drv_xpu_reg_val));
|
||||||
|
priv->drv_xpu_reg_val[DRV_XPU_REG_IDX_GIT_REV] = GIT_REV;
|
||||||
|
|
||||||
//turn on radio
|
//turn on radio
|
||||||
if (priv->tx_intf_cfg == TX_INTF_BW_20MHZ_AT_N_10MHZ_ANT1) {
|
if (priv->tx_intf_cfg == TX_INTF_BW_20MHZ_AT_N_10MHZ_ANT1) {
|
||||||
|
@ -76,6 +76,8 @@ union u16_byte2 {
|
|||||||
#define DRV_RX_REG_IDX_FREQ_BW_CFG 1
|
#define DRV_RX_REG_IDX_FREQ_BW_CFG 1
|
||||||
#define DRV_RX_REG_IDX_PRINT_CFG (MAX_NUM_DRV_REG-1)
|
#define DRV_RX_REG_IDX_PRINT_CFG (MAX_NUM_DRV_REG-1)
|
||||||
|
|
||||||
|
#define DRV_XPU_REG_IDX_GIT_REV (MAX_NUM_DRV_REG-1)
|
||||||
|
|
||||||
// ------end of software reg definition ------------
|
// ------end of software reg definition ------------
|
||||||
|
|
||||||
#define MAX_NUM_VIF 4
|
#define MAX_NUM_VIF 4
|
||||||
|
Binary file not shown.
@ -854,10 +854,10 @@
|
|||||||
reg = <0x43c00000 0xffff>;
|
reg = <0x43c00000 0xffff>;
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
@ -1002,10 +1002,10 @@
|
|||||||
reg = <0x43c00000 0xffff>;
|
reg = <0x43c00000 0xffff>;
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
dma@43000000 {
|
dma@43000000 {
|
||||||
compatible = "adi,axi-dmac-1.00.a";
|
compatible = "adi,axi-dmac-1.00.a";
|
||||||
|
Binary file not shown.
@ -843,10 +843,10 @@
|
|||||||
reg = <0x43c00000 0xffff>;
|
reg = <0x43c00000 0xffff>;
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
Binary file not shown.
@ -869,10 +869,10 @@
|
|||||||
phandle = <0x13>;
|
phandle = <0x13>;
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
dma@7c400000 {
|
dma@7c400000 {
|
||||||
compatible = "adi,axi-dmac-1.00.a";
|
compatible = "adi,axi-dmac-1.00.a";
|
||||||
|
Binary file not shown.
@ -865,10 +865,10 @@
|
|||||||
phandle = <0x13>;
|
phandle = <0x13>;
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
dma@7c400000 {
|
dma@7c400000 {
|
||||||
compatible = "adi,axi-dmac-1.00.a";
|
compatible = "adi,axi-dmac-1.00.a";
|
||||||
|
Binary file not shown.
@ -2569,10 +2569,10 @@
|
|||||||
dma-names = "tx";
|
dma-names = "tx";
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@85000000 {
|
/*axi-sysid-0@85000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x85000000 0x10000>;
|
reg = <0x85000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
};
|
};
|
||||||
|
|
||||||
clocks {
|
clocks {
|
||||||
|
Binary file not shown.
@ -754,10 +754,10 @@
|
|||||||
phandle = <0x15>;
|
phandle = <0x15>;
|
||||||
};
|
};
|
||||||
|
|
||||||
axi-sysid-0@45000000 {
|
/*axi-sysid-0@45000000 {
|
||||||
compatible = "adi,axi-sysid-1.00.a";
|
compatible = "adi,axi-sysid-1.00.a";
|
||||||
reg = <0x45000000 0x10000>;
|
reg = <0x45000000 0x10000>;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
i2c@41620000 {
|
i2c@41620000 {
|
||||||
compatible = "xlnx,axi-iic-1.01.b", "xlnx,xps-iic-2.00.a";
|
compatible = "xlnx,axi-iic-1.01.b", "xlnx,xps-iic-2.00.a";
|
||||||
|
@ -35,8 +35,8 @@ fi
|
|||||||
# detect SD card mounting status
|
# detect SD card mounting status
|
||||||
if [ -d "$SDCARD_DIR/BOOT/" ]; then
|
if [ -d "$SDCARD_DIR/BOOT/" ]; then
|
||||||
echo "$SDCARD_DIR/BOOT/"
|
echo "$SDCARD_DIR/BOOT/"
|
||||||
mkdir $SDCARD_DIR/BOOT/openwifi
|
sudo mkdir $SDCARD_DIR/BOOT/openwifi
|
||||||
rm -rf $SDCARD_DIR/BOOT/README.txt
|
sudo rm -rf $SDCARD_DIR/BOOT/README.txt
|
||||||
else
|
else
|
||||||
echo "$SDCARD_DIR/BOOT/ does not exist!"
|
echo "$SDCARD_DIR/BOOT/ does not exist!"
|
||||||
exit 1
|
exit 1
|
||||||
@ -95,23 +95,23 @@ do
|
|||||||
|
|
||||||
dtc -I dts -O dtb -o $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dts_filename_tmp
|
dtc -I dts -O dtb -o $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dts_filename_tmp
|
||||||
mkdir $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
mkdir $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
||||||
cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/$dtb_filename_tmp $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
||||||
cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME_TMP/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/openwifi/$BOARD_NAME_TMP
|
||||||
sudo true
|
sudo true
|
||||||
done
|
done
|
||||||
|
|
||||||
mkdir $SDCARD_DIR/BOOT/openwifi/zynq-common
|
sudo mkdir $SDCARD_DIR/BOOT/openwifi/zynq-common
|
||||||
cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/openwifi/zynq-common/
|
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/openwifi/zynq-common/
|
||||||
mkdir $SDCARD_DIR/BOOT/openwifi/zynqmp-common
|
sudo mkdir $SDCARD_DIR/BOOT/openwifi/zynqmp-common
|
||||||
cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/openwifi/zynqmp-common/
|
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/openwifi/zynqmp-common/
|
||||||
|
|
||||||
# Copy uImage BOOT.BIN and devicetree to SD card BOOT partition
|
# Copy uImage BOOT.BIN and devicetree to SD card BOOT partition
|
||||||
cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/$dtb_filename $SDCARD_DIR/BOOT/
|
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/$dtb_filename $SDCARD_DIR/BOOT/
|
||||||
cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/
|
sudo cp $OPENWIFI_DIR/kernel_boot/boards/$BOARD_NAME/output_boot_bin/BOOT.BIN $SDCARD_DIR/BOOT/
|
||||||
if [ "$BOARD_NAME" == "zcu102_fmcs2" ] || [ "$BOARD_NAME" == "zcu102_9371" ]; then
|
if [ "$BOARD_NAME" == "zcu102_fmcs2" ] || [ "$BOARD_NAME" == "zcu102_9371" ]; then
|
||||||
cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/
|
sudo cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME64/arch/arm64/boot/Image $SDCARD_DIR/BOOT/
|
||||||
else
|
else
|
||||||
cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/
|
suod cp $OPENWIFI_DIR/$LINUX_KERNEL_SRC_DIR_NAME32/arch/arm/boot/uImage $SDCARD_DIR/BOOT/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo mkdir $SDCARD_DIR/rootfs/root/openwifi
|
sudo mkdir $SDCARD_DIR/rootfs/root/openwifi
|
||||||
|
Loading…
Reference in New Issue
Block a user