From 0a92505df29ec29f8c8d2c89ee3380656014b603 Mon Sep 17 00:00:00 2001 From: Xianjun Jiao Date: Fri, 4 Sep 2020 10:57:04 +0200 Subject: [PATCH] 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 --- driver/make_all.sh | 1 + driver/sdr.c | 36 ++++++++++-------- driver/sdr.h | 2 + .../boards/adrv9361z7035/devicetree.dtb | Bin 20759 -> 20671 bytes .../boards/adrv9361z7035/devicetree.dts | 4 +- .../boards/adrv9361z7035_fmc/devicetree.dts | 4 +- .../boards/adrv9364z7020/devicetree.dtb | Bin 20544 -> 20456 bytes .../boards/adrv9364z7020/devicetree.dts | 4 +- kernel_boot/boards/zc702_fmcs2/devicetree.dtb | Bin 21867 -> 21779 bytes kernel_boot/boards/zc702_fmcs2/devicetree.dts | 4 +- kernel_boot/boards/zc706_fmcs2/devicetree.dtb | Bin 23256 -> 23168 bytes kernel_boot/boards/zc706_fmcs2/devicetree.dts | 4 +- kernel_boot/boards/zcu102_fmcs2/system.dtb | Bin 46905 -> 46817 bytes kernel_boot/boards/zcu102_fmcs2/system.dts | 4 +- kernel_boot/boards/zed_fmcs2/devicetree.dtb | Bin 21323 -> 21235 bytes kernel_boot/boards/zed_fmcs2/devicetree.dts | 4 +- user_space/update_sdcard.sh | 24 ++++++------ 17 files changed, 49 insertions(+), 42 deletions(-) diff --git a/driver/make_all.sh b/driver/make_all.sh index 3085958..39163a0 100755 --- a/driver/make_all.sh +++ b/driver/make_all.sh @@ -53,6 +53,7 @@ set -x home_dir=$(pwd) 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 cd $OPENWIFI_DIR/driver/openofdm_tx make KDIR=$LINUX_KERNEL_SRC_DIR ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE diff --git a/driver/sdr.c b/driver/sdr.c index 40f8d99..5bdd765 100644 --- a/driver/sdr.c +++ b/driver/sdr.c @@ -52,6 +52,7 @@ #include "../user_space/sdrctl_src/nl80211_testmode_def.h" #include "hw_def.h" #include "sdr.h" +#include "git_rev.h" // driver API of component driver 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 sk_buff *skb; 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; u8 *pdata_tmp, fcs_ok, target_buf_idx;//, phy_rx_sn_hw; 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 // dma_driver_buf_idx_mod = (state.residue&0x7f); fcs_ok = ((fcs_ok&0x80)!=0); - // ht_flag = ((rate_idx&0x10)!=0); + ht_flag = ((rate_idx&0x10)!=0); rate_idx = (rate_idx&0xF); 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; 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, - len, wifi_rate_table[rate_idx], hdr->frame_control, hdr->duration_id, + 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, 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), 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_high16 = *((u16*)(hdr->addr3)); } - if (len_mac_pdu>=28) - sc = hdr->seq_ctrl; duration_id = hdr->duration_id; 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); } +// 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) ) 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, @@ -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[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---------------- // /* 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_rx_reg_val, 0, sizeof(priv->drv_rx_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 if (priv->tx_intf_cfg == TX_INTF_BW_20MHZ_AT_N_10MHZ_ANT1) { diff --git a/driver/sdr.h b/driver/sdr.h index 9adbe70..69915fd 100644 --- a/driver/sdr.h +++ b/driver/sdr.h @@ -76,6 +76,8 @@ union u16_byte2 { #define DRV_RX_REG_IDX_FREQ_BW_CFG 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 ------------ #define MAX_NUM_VIF 4 diff --git a/kernel_boot/boards/adrv9361z7035/devicetree.dtb b/kernel_boot/boards/adrv9361z7035/devicetree.dtb index 71a7c190c4ac37fa50c8f542100a8102eea84d5e..d8090ff70cfc3f9e5b9efdd90db4d02be1646df7 100644 GIT binary patch delta 37 vcmV+=0NVeTq5;350T9p){_Ow&P`>~G05|{uK**607Xgs5D62fPD?RKJ{1Xi3 delta 119 zcmdnLka7AVMu7{w|K2h%1d1~-Fjz1!I4VpO5NCX`QDe1DAY)=hrfzX%ab}9HfrE*u w0T=+4fdDfQivqE9VoIhCLY<+Wfq`BkNC6Ol)NlZ?rz?oZ$iT4qjLm0Z001W$=Kufz diff --git a/kernel_boot/boards/adrv9361z7035/devicetree.dts b/kernel_boot/boards/adrv9361z7035/devicetree.dts index cfd0e27..074c2e4 100644 --- a/kernel_boot/boards/adrv9361z7035/devicetree.dts +++ b/kernel_boot/boards/adrv9361z7035/devicetree.dts @@ -854,10 +854,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ }; leds { diff --git a/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts b/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts index 4258848..cc92271 100644 --- a/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts +++ b/kernel_boot/boards/adrv9361z7035_fmc/devicetree.dts @@ -1002,10 +1002,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@43000000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/adrv9364z7020/devicetree.dtb b/kernel_boot/boards/adrv9364z7020/devicetree.dtb index 2b21f7777d813bc33d303ff8ba26e7c3a629b524..4bb587188b303c3edf0f31015b9ae9502e7c33d2 100644 GIT binary patch delta 38 ucmX@GfbqqAMu7{w|K2h%_`hIaV6b3daNwCJAjV{WWuwM>>&^K#7li>2$qkMG delta 120 zcmaDcpYgx~Mu7{w|K2h%1UN7-Fjz1!IHXJz5My%C*{Jc}I*>83B2%}xvN$tE*TBKV x)Bp^C>Og=Qh(&=|Ix!_v2cgbT&%i)05u^YJKx#OE*wYonV`O01EMRj(7yvze8IS+~ diff --git a/kernel_boot/boards/adrv9364z7020/devicetree.dts b/kernel_boot/boards/adrv9364z7020/devicetree.dts index 2bbd625..8a28b42 100644 --- a/kernel_boot/boards/adrv9364z7020/devicetree.dts +++ b/kernel_boot/boards/adrv9364z7020/devicetree.dts @@ -843,10 +843,10 @@ reg = <0x43c00000 0xffff>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ }; leds { diff --git a/kernel_boot/boards/zc702_fmcs2/devicetree.dtb b/kernel_boot/boards/zc702_fmcs2/devicetree.dtb index 06f4e02dfe13b7ec43e72508200727702810455f..6d59d72393b330623b89ddae24ab4d1571fdb8a8 100644 GIT binary patch delta 38 ucmaF8igEHPMu7{w|K2h%gbFh-Fjz1!xCl%X5My$_u~B1#$z}snYXt!I$P1+a delta 119 zcmbQdit+U-Mu7{w|K2h%gl01^Fjz1!xMWNe5My#N*r>6=Bp|UOQ@6OXI5S1pz`?}S w01SZ2K!6#DMS)m4F(p$6q0Ugxz(6k%qyPv&YB+${(-p*HWMJ5Q!Nges04ow1qW}N^ diff --git a/kernel_boot/boards/zc702_fmcs2/devicetree.dts b/kernel_boot/boards/zc702_fmcs2/devicetree.dts index 064c02a..0d13b18 100644 --- a/kernel_boot/boards/zc702_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zc702_fmcs2/devicetree.dts @@ -869,10 +869,10 @@ phandle = <0x13>; }; */ - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@7c400000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/zc706_fmcs2/devicetree.dtb b/kernel_boot/boards/zc706_fmcs2/devicetree.dtb index 441d0b3313fdca76ae47c57f27d7218ea6a0126d..4504ba326869076092cb28e3cc3bacb816621e03 100644 GIT binary patch delta 38 ucmcbym9b$fqre5;e{UHWq8b<&7%UhVJibg65M%P#vr%J>`DPu9HA(;tqzy>` delta 119 zcmZqJ%6MZdqre5;e{UHWqHZuSFjz1!c=}8f5M%Nb*{HF`JRq?mQ@6OXI5S1pz`?}S w01SZ2K!6#DMS)m4F(p$6q0Ugxz(6k%qyPv&YB+${(-p*HWMJ5Q#(aws074TQNB{r; diff --git a/kernel_boot/boards/zc706_fmcs2/devicetree.dts b/kernel_boot/boards/zc706_fmcs2/devicetree.dts index 1fee3f7..ee8f990 100644 --- a/kernel_boot/boards/zc706_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zc706_fmcs2/devicetree.dts @@ -865,10 +865,10 @@ phandle = <0x13>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ dma@7c400000 { compatible = "adi,axi-dmac-1.00.a"; diff --git a/kernel_boot/boards/zcu102_fmcs2/system.dtb b/kernel_boot/boards/zcu102_fmcs2/system.dtb index 71ed848f94781b8f46ffee92596ce7c3b537d0dd..cca508445730474e2d657a60aa7d39b8f74aabd6 100644 GIT binary patch delta 37 vcmV+=0NVe#?gHWM0uay*{_Ow&w&4H(05|{up_q{n7Xe_gD9@m?Poe4+En5#= delta 117 zcmaF(mTBiZCV>mQ|K2h%Y`0`!V6b3dSomS0fH>ohjT+|{_%kL}Wa<`I7H6jD8aP;( u8h`;%83-@~u_%a5(fg18V(?iY6bBaH@{o(Srh>KP92p1 diff --git a/kernel_boot/boards/zcu102_fmcs2/system.dts b/kernel_boot/boards/zcu102_fmcs2/system.dts index 4bf2081..d5406d2 100644 --- a/kernel_boot/boards/zcu102_fmcs2/system.dts +++ b/kernel_boot/boards/zcu102_fmcs2/system.dts @@ -2569,10 +2569,10 @@ dma-names = "tx"; }; - axi-sysid-0@85000000 { + /*axi-sysid-0@85000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x85000000 0x10000>; - }; + };*/ }; clocks { diff --git a/kernel_boot/boards/zed_fmcs2/devicetree.dtb b/kernel_boot/boards/zed_fmcs2/devicetree.dtb index d7023aa74371aee2422c05a6c538ad8f8711cdb8..280f234b393be72140151727b0e47382ba483137 100644 GIT binary patch delta 38 ucmX@TjPdhQMu7{w|K2h%1bt>;V6b3daMGA4AjahQVWY+j{ml{v#>xN_qztA2 delta 119 zcmeyol=1X3Mu7{w|K2h%1bZ_uFjz1!I5kWZ5My%k*r+i>KOnIpQ@6OXI5S1pz`?}S w01SZ2K!6#DMS)m4F(p$6q0Ugxz(6k%qyPv&YB+${(-p*HWMJ65L*H5%06f_lr2qf` diff --git a/kernel_boot/boards/zed_fmcs2/devicetree.dts b/kernel_boot/boards/zed_fmcs2/devicetree.dts index b99efaa..99f1637 100644 --- a/kernel_boot/boards/zed_fmcs2/devicetree.dts +++ b/kernel_boot/boards/zed_fmcs2/devicetree.dts @@ -754,10 +754,10 @@ phandle = <0x15>; }; - axi-sysid-0@45000000 { + /*axi-sysid-0@45000000 { compatible = "adi,axi-sysid-1.00.a"; reg = <0x45000000 0x10000>; - }; + };*/ i2c@41620000 { compatible = "xlnx,axi-iic-1.01.b", "xlnx,xps-iic-2.00.a"; diff --git a/user_space/update_sdcard.sh b/user_space/update_sdcard.sh index d1c75bc..da7cc18 100755 --- a/user_space/update_sdcard.sh +++ b/user_space/update_sdcard.sh @@ -35,8 +35,8 @@ fi # detect SD card mounting status if [ -d "$SDCARD_DIR/BOOT/" ]; then echo "$SDCARD_DIR/BOOT/" - mkdir $SDCARD_DIR/BOOT/openwifi - rm -rf $SDCARD_DIR/BOOT/README.txt + sudo mkdir $SDCARD_DIR/BOOT/openwifi + sudo rm -rf $SDCARD_DIR/BOOT/README.txt else echo "$SDCARD_DIR/BOOT/ does not exist!" 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 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 - 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/$dtb_filename_tmp $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 done -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/ -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 mkdir $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/ +sudo mkdir $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 -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/$dtb_filename $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 - 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 - 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 sudo mkdir $SDCARD_DIR/rootfs/root/openwifi