Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Engineering libbl602_wifi #29

Draft
wants to merge 150 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
7486028
ignore build folder
Yangff Jul 21, 2021
39ab9ce
Plan: replace object files in libbl602_wifi one by one
Yangff Jul 21, 2021
d17771e
return field after added
Yangff Jul 21, 2021
80db0ac
add more reg from phy_bl602.o
Yangff Jul 21, 2021
fed3a5a
update mdm.h with regs found in phy_bl602.o
Yangff Jul 21, 2021
8898ba5
add missing bit
Yangff Jul 21, 2021
2a14d5a
add bit
Yangff Jul 21, 2021
b778274
add missing rxndpnstsmax
Yangff Jul 21, 2021
427e66d
generate agc code automatically
Yangff Jul 21, 2021
1eda44a
add used functions in header
Yangff Jul 21, 2021
2e9d772
finish phy_bl602
Yangff Jul 21, 2021
d395b9a
support parse bl svd file and find reg with addr and mask
Yangff Jul 22, 2021
ad428c3
no longer need to print the access code
Yangff Jul 22, 2021
d77652c
add missing bit
Yangff Jul 21, 2021
f910c82
add bit
Yangff Jul 21, 2021
cfbeae3
add missing rxndpnstsmax
Yangff Jul 21, 2021
26793ff
add bz_phyfunc
Yangff Jul 22, 2021
377b3c2
add bz_phy.h
Yangff Jul 22, 2021
3ce657a
add support for 0x
Yangff Jul 22, 2021
55be85b
foreach in scan
Yangff Jul 22, 2021
7261e1c
add support for 0x
Yangff Jul 22, 2021
ec71269
fix bz_phy.c
Yangff Jul 22, 2021
f32ad88
add bz_phy_reset
Yangff Jul 22, 2021
c98ef5a
new header
Yangff Jul 22, 2021
fc7f9f8
support parse bl svd file and find reg with addr and mask
Yangff Jul 22, 2021
58095db
add bz_phyfunc
Yangff Jul 22, 2021
c8111a7
more stable name
Yangff Jul 23, 2021
5a877e6
add extra information from DWARF
Yangff Jul 24, 2021
95cf6ec
add extra names
Yangff Jul 24, 2021
80069a9
import other DWARF info and done
Yangff Jul 24, 2021
16d67b8
padding to 32
Yangff Jul 24, 2021
89d1c9c
done
Yangff Jul 24, 2021
5968b95
put irqmacccatimeouten as field name
Yangff Jul 24, 2021
bdac239
fix agc
Yangff Jul 24, 2021
5ab3eca
fix var names
Yangff Jul 24, 2021
c158eea
fix regs and add phy_adapt
Yangff Jul 25, 2021
e7b27ce
fix error and warn
Yangff Jul 25, 2021
81745e5
add offset fixed svd
Yangff Jul 25, 2021
17a12b1
bug fix for field iterator
Yangff Jul 25, 2021
e3d7c8f
add phy_hal
Yangff Jul 25, 2021
da8f1d5
add phy_helper
Yangff Jul 25, 2021
b346a66
add rf_priv header
Yangff Jul 25, 2021
49a3fd6
fix return true
Yangff Jul 25, 2021
1106214
add tcal
Yangff Jul 25, 2021
9088483
add trpc
Yangff Jul 25, 2021
1ffd6cb
fix redefinition and memset
Yangff Jul 25, 2021
184aa2c
using rv32 and c11
Yangff Jul 25, 2021
f4959fc
add memcpy and min/max
Yangff Jul 25, 2021
f20f255
fix type
Yangff Jul 25, 2021
9079d1e
add phyif_utils
Yangff Jul 25, 2021
0a747be
add rf
Yangff Jul 25, 2021
7144472
typo
Yangff Jul 25, 2021
306eed0
update phy
Yangff Jul 25, 2021
9195c86
Merge branch 'bl602_wifi' into nc_wifi
Yangff Jul 26, 2021
c2828b0
update rf header
Yangff Jul 26, 2021
ddf9615
back to * -510
Yangff Jul 30, 2021
29e8a77
fix ;
Yangff Sep 22, 2021
ceb548b
headers for SOC
Yangff Oct 28, 2021
63427a3
partial link library
Yangff Oct 28, 2021
ad04214
reg scanner
Yangff Oct 28, 2021
9f91b71
preliminary decompiled code
Yangff Oct 28, 2021
50d981a
add clang build option
Yangff Dec 19, 2021
c126e6a
add github action
Yangff Dec 19, 2021
e85555d
update command
Yangff Dec 19, 2021
d140eee
update artifact path
Yangff Dec 19, 2021
babe32b
update path
Yangff Dec 19, 2021
09b7916
add ble
Yangff Dec 19, 2021
b1b6e33
implementation of bl602 wifi phy with reverse eng and existed code
Yangff Dec 19, 2021
28e501e
update readme
Yangff Dec 19, 2021
c5250a0
fix dup symbols
Yangff Dec 21, 2021
d0fa9a1
add rf_dump_status
Yangff Dec 21, 2021
5b994a0
fix volatile attr in the pointer
Yangff Dec 23, 2021
d9ccd5d
modify retry logic
Yangff Dec 23, 2021
65ad969
change volatile order in the type
Yangff Dec 23, 2021
9803c20
add some ignores
Yangff Dec 23, 2021
d65e629
move macro to global
Yangff Dec 23, 2021
05d666f
adding sysctrl and ipc
Yangff Dec 23, 2021
becea0d
update IPC regs
Yangff Dec 23, 2021
1845f40
use new macro
Yangff Dec 23, 2021
6537668
reduce warning
Yangff Dec 23, 2021
db03980
sysctrl_init()
Yangff Dec 23, 2021
0231b45
ipc and related headers
Yangff Dec 23, 2021
c1258fa
bl602_demo_wifi.elf built w/o -Wl,--gc-sections
Yangff Dec 23, 2021
935e56a
use freertos ram by default
Yangff Dec 23, 2021
450227c
add intc and fix bug on agc.h
Yangff Dec 23, 2021
d95a37f
add intc from alios
Yangff Dec 23, 2021
501051b
fix irq_index size
Yangff Dec 23, 2021
748ad2e
add hals on hal folder
Yangff Dec 23, 2021
5757b40
update hal location
Yangff Dec 23, 2021
a384bd2
add intc
Yangff Dec 23, 2021
fe5858e
fix intc
Yangff Dec 23, 2021
43d8932
fix intc
Yangff Dec 23, 2021
0a5f4ad
add hal_dma
Yangff Dec 23, 2021
c95092d
add diag_trigger
Yangff Dec 23, 2021
7e68b0b
update mac core
Yangff Dec 24, 2021
f5aae1f
add coexAutoPTIAdjEnable
Yangff Dec 24, 2021
d48da67
add arch related init code
Yangff Dec 24, 2021
0c3f483
add a useless enum
Yangff Dec 24, 2021
ab03273
use ll.h
Yangff Dec 24, 2021
29dfc41
remove dup ipc_host_disable_irq_e2a(void)
Yangff Dec 24, 2021
60f8152
satisfying bl602 linker script
Yangff Dec 24, 2021
db41e5a
fix txdesc copy
Yangff Dec 24, 2021
56ae7f5
add finished drivers
Yangff Dec 24, 2021
262c848
fix gcc build
Yangff Dec 24, 2021
7b1f08e
add header
Yangff Dec 24, 2021
f104c24
remove duplicated bz_phy_reset
Yangff Dec 24, 2021
3c14da3
add includes
Yangff Dec 24, 2021
26f7119
use stdbool.h for bool
Yangff Dec 24, 2021
9852398
add modules/common
Yangff Dec 24, 2021
181c583
ke_event
Yangff Dec 25, 2021
7cc6378
add some common functions
Yangff Dec 25, 2021
5331917
fix ABS_TIMER array
Yangff Dec 25, 2021
73b6ee3
prevent included twice
Yangff Dec 25, 2021
6f745be
fix ABS_TIMER
Yangff Dec 25, 2021
f1b74df
use ke_event
Yangff Dec 25, 2021
9252f4a
ke_task
Yangff Dec 25, 2021
3774c8d
memory management
Yangff Dec 25, 2021
7ff1855
ke_task
Yangff Dec 25, 2021
081015b
add return value
Yangff Dec 25, 2021
c9842db
other ke impl
Yangff Dec 25, 2021
8bef6a3
use assert in arch
Yangff Dec 25, 2021
8cf8ace
use ke_param2msg and ke_msg2param
Yangff Dec 25, 2021
5b5be2c
Finish ke_task
Yangff Dec 25, 2021
fc3bd59
mac
Yangff Dec 25, 2021
f692811
mac_ie
Yangff Dec 25, 2021
b5ae586
modules/dbg
Yangff Dec 26, 2021
18a9299
lmac/bl
Yangff Dec 26, 2021
3faaafb
add memcmp
Yangff Dec 28, 2021
3b6915c
add ASSERT_WARN
Yangff Dec 28, 2021
85d5ef6
moving config to seperated file
Yangff Dec 28, 2021
76d15fc
use config
Yangff Dec 28, 2021
65bf905
lmac/chan
Yangff Dec 28, 2021
3b1ba35
add CHAN_SWITCH_TO_DUR
Yangff Dec 28, 2021
cd4a68f
enable lmac/chan
Yangff Dec 28, 2021
c19b312
format, using space
Yangff Dec 28, 2021
448cf71
working on lmac/mm
Yangff Dec 30, 2021
de1eef4
update phy_init decl
Yangff Jan 1, 2022
c7761ee
add encr_ram_config
Yangff Jan 1, 2022
a72bb1c
add mm_task and mm_timer
Yangff Jan 1, 2022
9ff4dc2
finish mm_hw_config_handler
Yangff Jan 1, 2022
9086529
add more constants
Yangff Jan 1, 2022
126c182
move ipc_emb_tx_q_has_data to header
Yangff Jan 3, 2022
7b2dc52
update headers
Yangff Jan 3, 2022
cc218f1
add mm_traffic_req_ind
Yangff Jan 3, 2022
e395df6
add BCN_MAX_CSA_CPT
Yangff Jan 3, 2022
bb20810
add mm_bcn
Yangff Jan 3, 2022
4abff2d
adding new codes
Yangff Jan 31, 2023
3c5d1c0
vif done, only txl left
Yangff Feb 1, 2023
1603c92
typo
Yangff Feb 1, 2023
d10e3e2
working on txl
Yangff Feb 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
import other DWARF info and done
  • Loading branch information
Yangff committed Jul 24, 2021
commit 80069a967bf92bc6e1bfc4db1307371a29c4b985
70 changes: 35 additions & 35 deletions script/manualext.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@
Field('txcbwmax', 0xfcffffff) # Channel bandwidth
Field('txnssmax', 0xffffff8f) # number of spatial streams
Field('ntxmax', 0xff8fffff) # tx chan?
Field('v18', 0xfffffeff) # some switch? DAT_44c00000>>18
Field('txldpcen', 0xfffffeff) # some switch? DAT_44c00000>>18
Field('vht', 0xfffffffd) # very high throughput
Field('v31', 0xfffeffff) # some switch? DAT_44c00000>>31
Field('txmumimoen', 0xfffeffff) # some switch? DAT_44c00000>>31

Reg('rxchan', 0x44c00820)
Field('rxcbwmax', 0xfcffffff) # Channel bandwidth
Field('rxnssmax', 0xffffff8f) # number of spatial streams
# Field('nrxmax', 0xff8fffff) # not exists
Field('v19', 0xfffffeff) # some switch? DAT_44c00000>>19
Field('vht', 0xfffffffd) # very high throughput
Field('v30', 0xfffeffff) # some switch? DAT_44c00000>>30
Field('_v30', 0xffefffff) # some switch? DAT_44c00000>>30
FieldBit('reset', 0) # set 1 in phy_hw_set_channel for.. reset?
Field('rxldpcen', 0xfffffeff) # some switch? DAT_44c00000>>19
Field('rxvhten', 0xfffffffd) # very high throughput
Field('rxmumimoen', 0xfffeffff) # some switch? DAT_44c00000>>30
Field('rxmumimoapeplenen', 0xffefffff) # some switch? DAT_44c00000>>30
FieldBit('rxdsssen', 0) # set 1 in phy_hw_set_channel for.. reset?
Field('rxndpnstsmax', 0xffff8fff)

Reg('version', 0x44c00000)
FieldBit('vht', 31-9)
FieldBit('nss', 8, 4) # phy_get_nss (nss + 1)
FieldBit('rxndpnstsmax', 0xc, 4)
FieldBit('v18', 0x12)
FieldBit('v19', 0x13)
FieldBit('nsts', 0xc, 4)
FieldBit('ldpcenc', 0x12)
FieldBit('ldpcdec', 0x13)
FieldBit('mu_mimo_rx', 0x1e)
FieldBit('mu_mimo_tx', 0x1f)
FieldBit('ldpctx', 0x1a)
FieldBit('ldpcrx', 0x1b)
FieldBit('ntx', 4, 4) # phy_get_ntx (ntx + 1)
FieldBit('txcbwmax', 0x18, 2)
FieldBit('chbw', 0x18, 2)
FieldBit('bfmee_supported', 0x1c)
FieldBit('bfmer_supported', 0x1d)

Expand All @@ -50,9 +50,9 @@
FieldBit('FSMSWRESET', 4)
FieldBit('MDMSWRESET', 0)

Reg('TXCTRL0', 0x44c00838)
Reg('TXCTRL1', 0x44c0088c)
Reg('TXCTRL3', 0x44c00898)
Reg('txstartdelay', 0x44c00838)
Reg('txctrl1', 0x44c0088c)
Reg('txctrl3', 0x44c00898)

Reg('TBECTRL0', 0x44c00858)
Field('tbe_count_adjust_20', 0xffffff00)
Expand All @@ -62,8 +62,8 @@
Field('WAITHTSTF', 0xffffff80)

Reg('r834', 0x44c00834)
Field('set60h', 0x00ffffff)
FieldBit('set1', 0)
Field('tddchtstfmargin', 0x00ffffff)
FieldBit('rxtdctrl1', 0)

Reg('SMOOTHCTRL', 0x44c00818)
FieldBit('TDCYCROTVAL20', 0, 8)
Expand Down Expand Up @@ -93,7 +93,7 @@
Reg('rxctrl1', 0x44c0083c) # reset to 0x4920492

Reg('r0x874', 0x44c00874)
Field('resetto1', 0xf7ffffff)
Field('rcclkforce', 0xf7ffffff)
Field('mdm_agcmemclkforce', 0xdfffffff)
#print('\n'.join(GenSVD()))

Expand All @@ -116,9 +116,9 @@


Reg('RWNXAGCCNTL', 0x44c0b390)
Field('set1', 0xfffffffc)
Field('combpathsel', 0xfffffffc)
Field('agcfsmreset', 0xffffefff) # set 1 before agc mem, maybe

Field('rifsdeten', 0xfffffbff)
Reg('riu_rwnxagcaci20marg0', 0x44c0b340)
Reg('riu_rwnxagcaci20marg1', 0x44c0b344)
Reg('riu_rwnxagcaci20marg2', 0x44c0b348)
Expand All @@ -132,13 +132,14 @@
Reg('irqmacccatimeouten', 0x44c0b414)
Field('set1', 0xFFFFFEFF)

Reg('r41c', 0x44c0b41c)
Reg('rwnxmacintstatmasked', 0x44c0b41c)
FieldBit('needreset', 8) # guess
Reg('r420_copy41c', 0x44c0b420)

Reg('rwnxmacintack', 0x44c0b420)


Reg('rc218', 0x44c0c218)
Field('set0', 0xffff0000)
Field('txhbf20coeffsel', 0xffff0000)

Buf('rxgain_offset_vs_temperature', 0x44c0c080, 0x44c0c088, 1)

Expand Down Expand Up @@ -347,13 +348,13 @@ def getregs(fname, pattern='name'):

peris['dma'] = Peripheral(peripheral('dma', 0x44a00000, 0x1000))

Reg('status', 0x44a00024)
Reg('int_status', 0x44a00024)
Field("TX", 0x1f)
FieldBit("RXHeader", 5) ## guess
FieldBit("RXPayload", 6) ## guess
FieldBit("b8", 8)

Reg('tx_reset', 0x44a00020) # my guess, setting of r20 should reset 0x24??
Reg('int_ack', 0x44a00020) # my guess, setting of r20 should reset 0x24??
# kind like response...
FieldBit("b8", 8) # set at txl_cfm_dma_int_handler
FieldBit("b7", 7) # set at ipc_emb_dbg_dma_int_handler
Expand All @@ -362,9 +363,10 @@ def getregs(fname, pattern='name'):
Field("TX", 0x1f)

Reg("dma_status", 0x44a00010)
Field("busyatffff", 0xffff)
Field("dma_status_oft_free", 0xffff)

# my guess!!
# access with dma_lli_counter_get(reg_idx)
Reg('TX_BCN', 0x44a00080)
FieldBit('bridgedmacnt', 0, 16)
Reg('TX_AC_0', 0x44a00084)
Expand All @@ -377,9 +379,9 @@ def getregs(fname, pattern='name'):
FieldBit('bridgedmacnt', 0, 16)

Reg('LinkListItem0', 0x44a000a4)
FieldBit("lli", 0, 16)
FieldBit("counter", 0, 16)
Reg('LinkListItem1', 0x44a000ac)
FieldBit("lli", 0, 16)
FieldBit("counter", 0, 16)

#open('../src/include/phy/dma.h', 'w').write('\n'.join(GenHeader()))
#print('\n'.join(GenHeader()))
Expand All @@ -390,16 +392,14 @@ def getregs(fname, pattern='name'):
peris['sysctrl'] = Peripheral(peripheral('sysctrl', 0x44900000, 0x1000))
Reg('time', 0x44900084)
FieldBit('time_greater_on_bit12', 0)
Reg("sysctrl_r68", 0x44900068) # set to 0x8000000c for init
Reg("sysctrl_re0", 0x449000e0) # or with 0x1ff00
Field("set1", (~0x1ff00) & 0xffffffff)
Reg("diag_conf", 0x44900068) # set to 0x8000000c for init
Field("diag_sel", 0xffff0000)

Reg("misc_cntl", 0x449000e0) # or with 0x1ff00
Field("set1", (~0x1ff00) & 0xffffffff)

## two regs for helper_record_all_states
Reg("r068", 0x44900068)
Field("set14", 0xffff0000)

Reg("r074", 0x44900068) # set to b09
Reg("r074", 0x44900074) # set to b09

#open('../src/include/phy/sysctrl.h', 'w').write('\n'.join(GenHeader()))
#print('\n'.join(GenHeader()))
Expand All @@ -410,7 +410,7 @@ def getregs(fname, pattern='name'):
## wtf is this???

peris['sysctrl92'] = Peripheral(peripheral('sysctrl92', 0x44920000, 0x1000))
Reg("set5010001f", 0x44920004)
Reg("ptr_config", 0x44920004)

#open('../src/include/phy/sysctrl92.h', 'w').write('\n'.join(GenHeader()))
#print('\n'.join(GenHeader()))
Expand Down
8 changes: 4 additions & 4 deletions src/include/phy/agc.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t set1 : 2; // @ 1 -- 0 # 0xfffffffc
uint32_t combpathsel : 2; // @ 1 -- 0 # 0xfffffffc
uint32_t pad0 : 6;
uint32_t riu_rifsdeten : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t pad1 : 1;
Expand Down Expand Up @@ -183,8 +183,8 @@ typedef union {
uint32_t pad0 : 8;
uint32_t needreset : 1; // @ 8 -- 8 # 0xfffffeff
};
} r41c; // @ 0x41c
uint32_t r420_copy41c; // @ 0x420
} rwnxmacintstatmasked; // @ 0x41c
uint32_t rwnxmacintack; // @ 0x420
uint8_t pad9[0xdc];
union {
uint32_t value;
Expand Down Expand Up @@ -223,7 +223,7 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t set0 : 16; // @ 15 -- 0 # 0xffff0000
uint32_t txhbf20coeffsel : 16; // @ 15 -- 0 # 0xffff0000
};
} rc218; // @ 0x1218
uint8_t pad14[0x5f8];
Expand Down
10 changes: 5 additions & 5 deletions src/include/phy/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ typedef union {
uint32_t value;
struct {
uint32_t pad0 : 16;
uint32_t busyatffff : 16; // @ 31 -- 16 # 0xffff
uint32_t dma_status_oft_free : 16; // @ 31 -- 16 # 0xffff
};
} dma_status; // @ 0x10
uint8_t pad1[0xc];
Expand All @@ -21,7 +21,7 @@ typedef union {
uint32_t b8 : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t TX : 27; // @ 31 -- 5 # 0x1f
};
} tx_reset; // @ 0x20
} int_ack; // @ 0x20
union {
uint32_t value;
struct {
Expand All @@ -32,7 +32,7 @@ typedef union {
uint32_t b8 : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t TX : 27; // @ 31 -- 5 # 0x1f
};
} status; // @ 0x24
} int_status; // @ 0x24
uint8_t pad2[0x58];
union {
uint32_t value;
Expand Down Expand Up @@ -68,14 +68,14 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t lli : 16; // @ 15 -- 0 # 0xffff0000
uint32_t counter : 16; // @ 15 -- 0 # 0xffff0000
};
} LinkListItem0; // @ 0xa4
uint8_t pad4[0x4];
union {
uint32_t value;
struct {
uint32_t lli : 16; // @ 15 -- 0 # 0xffff0000
uint32_t counter : 16; // @ 15 -- 0 # 0xffff0000
};
} LinkListItem1; // @ 0xac
};
Expand Down
34 changes: 17 additions & 17 deletions src/include/phy/mdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ typedef union {
uint32_t pad0 : 4;
uint32_t ntx : 4; // @ 7 -- 4 # 0xffffff0f
uint32_t nss : 4; // @ 11 -- 8 # 0xfffff0ff
uint32_t rxndpnstsmax : 4; // @ 15 -- 12 # 0xffff0fff
uint32_t nsts : 4; // @ 15 -- 12 # 0xffff0fff
uint32_t pad1 : 2;
uint32_t v18 : 1; // @ 18 -- 18 # 0xfffbffff
uint32_t v19 : 1; // @ 19 -- 19 # 0xfff7ffff
uint32_t ldpcenc : 1; // @ 18 -- 18 # 0xfffbffff
uint32_t ldpcdec : 1; // @ 19 -- 19 # 0xfff7ffff
uint32_t pad2 : 2;
uint32_t vht : 1; // @ 22 -- 22 # 0xffbfffff
uint32_t pad3 : 1;
uint32_t txcbwmax : 2; // @ 25 -- 24 # 0xfcffffff
uint32_t chbw : 2; // @ 25 -- 24 # 0xfcffffff
uint32_t ldpctx : 1; // @ 26 -- 26 # 0xfbffffff
uint32_t ldpcrx : 1; // @ 27 -- 27 # 0xf7ffffff
uint32_t bfmee_supported : 1; // @ 28 -- 28 # 0xefffffff
Expand Down Expand Up @@ -49,18 +49,18 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t reset : 1; // @ 0 -- 0 # 0xfffffffe
uint32_t vht : 1; // @ 1 -- 1 # 0xfffffffd
uint32_t rxdsssen : 1; // @ 0 -- 0 # 0xfffffffe
uint32_t rxvhten : 1; // @ 1 -- 1 # 0xfffffffd
uint32_t pad0 : 2;
uint32_t rxnssmax : 3; // @ 6 -- 4 # 0xffffff8f
uint32_t pad1 : 1;
uint32_t v19 : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t rxldpcen : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t pad2 : 3;
uint32_t rxndpnstsmax : 3; // @ 14 -- 12 # 0xffff8fff
uint32_t pad3 : 1;
uint32_t v30 : 1; // @ 16 -- 16 # 0xfffeffff
uint32_t rxmumimoen : 1; // @ 16 -- 16 # 0xfffeffff
uint32_t pad4 : 3;
uint32_t _v30 : 1; // @ 20 -- 20 # 0xffefffff
uint32_t rxmumimoapeplenen : 1; // @ 20 -- 20 # 0xffefffff
uint32_t pad5 : 3;
uint32_t rxcbwmax : 2; // @ 25 -- 24 # 0xfcffffff
};
Expand All @@ -73,9 +73,9 @@ typedef union {
uint32_t pad1 : 2;
uint32_t txnssmax : 3; // @ 6 -- 4 # 0xffffff8f
uint32_t pad2 : 1;
uint32_t v18 : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t txldpcen : 1; // @ 8 -- 8 # 0xfffffeff
uint32_t pad3 : 7;
uint32_t v31 : 1; // @ 16 -- 16 # 0xfffeffff
uint32_t txmumimoen : 1; // @ 16 -- 16 # 0xfffeffff
uint32_t pad4 : 3;
uint32_t ntxmax : 3; // @ 22 -- 20 # 0xff8fffff
uint32_t pad5 : 1;
Expand All @@ -93,12 +93,12 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t set1 : 1; // @ 0 -- 0 # 0xfffffffe
uint32_t rxtdctrl1 : 1; // @ 0 -- 0 # 0xfffffffe
uint32_t pad0 : 23;
uint32_t set60h : 8; // @ 31 -- 24 # 0xffffff
uint32_t tddchtstfmargin : 8; // @ 31 -- 24 # 0xffffff
};
} r834; // @ 0x834
uint32_t TXCTRL0; // @ 0x838
uint32_t txstartdelay; // @ 0x838
uint32_t rxctrl1; // @ 0x83c
uint8_t pad3[0x18];
union {
Expand All @@ -114,7 +114,7 @@ typedef union {
uint32_t value;
struct {
uint32_t pad0 : 27;
uint32_t resetto1 : 1; // @ 27 -- 27 # 0xf7ffffff
uint32_t rcclkforce : 1; // @ 27 -- 27 # 0xf7ffffff
uint32_t pad1 : 1;
uint32_t mdm_agcmemclkforce : 1; // @ 29 -- 29 # 0xdfffffff
};
Expand All @@ -132,9 +132,9 @@ typedef union {
uint32_t AGCSWRESET : 1; // @ 12 -- 12 # 0xffffefff
};
} swreset; // @ 0x888
uint32_t TXCTRL1; // @ 0x88c
uint32_t txctrl1; // @ 0x88c
uint8_t pad7[0x8];
uint32_t TXCTRL3; // @ 0x898
uint32_t txctrl3; // @ 0x898
uint32_t rxframeviolationmask; // @ 0x89c
uint8_t pad8[0x2784];
union {
Expand Down
12 changes: 7 additions & 5 deletions src/include/phy/sysctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@ typedef union {
union {
uint32_t value;
struct {
uint32_t set14 : 16; // @ 15 -- 0 # 0xffff0000
uint32_t diag_sel : 16; // @ 15 -- 0 # 0xffff0000
};
} sysctrl_r68; // @ 0x68
uint8_t pad1[0x18];
} diag_conf; // @ 0x68
uint8_t pad1[0x8];
uint32_t r074; // @ 0x74
uint8_t pad2[0xc];
union {
uint32_t value;
struct {
uint32_t time_greater_on_bit12 : 1; // @ 0 -- 0 # 0xfffffffe
};
} time; // @ 0x84
uint8_t pad2[0x58];
uint8_t pad3[0x58];
union {
uint32_t value;
struct {
uint32_t pad0 : 8;
uint32_t set1 : 9; // @ 16 -- 8 # 0xfffe00ff
};
} sysctrl_re0; // @ 0xe0
} misc_cntl; // @ 0xe0
};
} sysctrl_regs;
#define SYSCTRL_BASE 0x44900000
Expand Down
2 changes: 1 addition & 1 deletion src/include/phy/sysctrl92.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ typedef union {
uint8_t pad[0x1000];
struct {
uint8_t pad0[0x4];
uint32_t set5010001f; // @ 0x4
uint32_t ptr_config; // @ 0x4
};
} sysctrl92_regs;
#define SYSCTRL92_BASE 0x44920000
Expand Down