@@ -35,6 +35,23 @@ GPIO_DT_SPEC_GET(NRF7002_NODE, iovdd_ctrl_gpios);
3535static const struct gpio_dt_spec bucken_spec =
3636GPIO_DT_SPEC_GET (NRF7002_NODE , bucken_gpios );
3737
38+ #ifdef CONFIG_WIFI_NRF71
39+ char blk_name [][15 ] = { "WIFIMCU_REG" , "RAM0" , "RAM1" , "DATARAM" ,
40+ "CODERAM" , "RAM2" , "BELLBOARD" , "GRTC" , "WICR" , "SECURERAM" };
41+
42+ uint32_t rpu_7002_memmap [][3 ] = {
43+ { 0x000000 , 0x0FFFFF , 1 },
44+ { 0x100000 , 0x17FFFF , 1 }, /* RAM0 is LMAC Memory */
45+ { 0x180000 , 0x1FFFFF , 1 }, /* RAM1 is UMAC Memory */
46+ { 0x200000 , 0x2FFFFF , 0 }, /* PKTRAM is DATARAM */
47+ { 0x300000 , 0x37FFFF , 1 }, /* CODERAM is ROM (LMAC & UMAC) */
48+ { 0x3C0000 , 0x3DFFFF , 2 }, /* RAM2 is GRAM */
49+ { 0x380000 , 0x38FFFF , 1 }, /* BELLBOARD */
50+ { 0x392000 , 0x393FFF , 1 }, /* GRTC */
51+ { 0x3B0000 , 0x3BFFFF , 1 }, /* WICR */
52+ { 0x3e0000 , 0x3FFFFB , 1 } /* Secure RAM */
53+ };
54+ #else
3855char blk_name [][15 ] = { "SysBus" , "ExtSysBus" , "PBus" , "PKTRAM" ,
3956 "GRAM" , "LMAC_ROM" , "LMAC_RET_RAM" , "LMAC_SRC_RAM" ,
4057 "UMAC_ROM" , "UMAC_RET_RAM" , "UMAC_SRC_RAM" };
@@ -52,6 +69,7 @@ uint32_t rpu_7002_memmap[][3] = {
5269 { 0x280000 , 0x2A4000 , 1 },
5370 { 0x300000 , 0x338000 , 1 }
5471};
72+ #endif /* CONFIG_WIFI_NRF71 */
5573
5674static const struct qspi_dev * qdev ;
5775static struct qspi_config * cfg ;
@@ -66,7 +84,11 @@ static int validate_addr_blk(uint32_t start_addr,
6684
6785 if (((start_addr >= block_map [0 ]) && (start_addr <= block_map [1 ])) &&
6886 ((end_addr >= block_map [0 ]) && (end_addr <= block_map [1 ]))) {
87+ #ifdef CONFIG_WIFI_NRF71
88+ if (block_no == DATARAM ) {
89+ #else
6990 if (block_no == PKTRAM ) {
91+ #endif /* CONFIG_WIFI_NRF71 */
7092 * hl_flag = 0 ;
7193 }
7294 * selected_blk = block_no ;
@@ -76,7 +98,11 @@ static int validate_addr_blk(uint32_t start_addr,
7698 return -1 ;
7799}
78100
101+ #ifdef CONFIG_WIFI_NRF71
102+ int rpu_validate_addr (uint32_t start_addr , uint32_t len , bool * hl_flag )
103+ #else /* CONFIG_WIFI_NRF71 */
79104static int rpu_validate_addr (uint32_t start_addr , uint32_t len , bool * hl_flag )
105+ #endif /* !CONFIG_WIFI_NRF71 */
80106{
81107 int ret = 0 , i ;
82108 uint32_t end_addr ;
@@ -97,8 +123,11 @@ static int rpu_validate_addr(uint32_t start_addr, uint32_t len, bool *hl_flag)
97123 LOG_ERR ("Address validation failed - pls check memmory map and re-try" );
98124 return -1 ;
99125 }
100-
126+ #ifdef CONFIG_WIFI_NRF71
127+ if (selected_blk == CODERAM ) {
128+ #else /* CONFIG_WIFI_NRF71 */
101129 if ((selected_blk == LMAC_ROM ) || (selected_blk == UMAC_ROM )) {
130+ #endif /* !CONFIG_WIFI_NRF71 */
102131 LOG_ERR ("Error: Cannot write to ROM blocks" );
103132 return -1 ;
104133 }
@@ -168,8 +197,11 @@ int rpu_irq_remove(struct gpio_callback *irq_callback_data)
168197out :
169198 return ret ;
170199}
171-
200+ #ifdef CONFIG_WIFI_NRF71
201+ int rpu_gpio_config (void )
202+ #else /* CONFIG_WIFI_NRF71 */
172203static int rpu_gpio_config (void )
204+ #endif /* !CONFIG_WIFI_NRF71 */
173205{
174206 int ret ;
175207
@@ -221,7 +253,11 @@ static int rpu_gpio_remove(void)
221253 return ret ;
222254}
223255
256+ #ifdef CONFIG_WIFI_NRF71
257+ int rpu_pwron (void )
258+ #else /* CONFIG_WIFI_NRF71 */
224259static int rpu_pwron (void )
260+ #endif /* !CONFIG_WIFI_NRF71 */
225261{
226262 int ret ;
227263
@@ -487,12 +523,14 @@ int rpu_enable(void)
487523 * successfully before it can be called. So, disable this for
488524 * nrf70_buslib only usage.
489525 */
526+ #ifndef CONFIG_WIFI_NRF71
490527#ifdef CONFIG_WIFI_NRF70
491528 ret = rpu_validate_comms ();
492529 if (ret ) {
493530 goto rpu_pwroff ;
494531 }
495532#endif
533+ #endif /* !CONFIG_WIFI_NRF71 */
496534 return 0 ;
497535rpu_pwroff :
498536 rpu_pwroff ();
0 commit comments