@@ -103,7 +103,7 @@ static void fespi_disable_hw_mode(volatile uint32_t *ctrl_base);
103103static void fespi_enable_hw_mode (volatile uint32_t * ctrl_base );
104104static int fespi_wip (volatile uint32_t * ctrl_base );
105105static int fespi_write_buffer (volatile uint32_t * ctrl_base ,
106- const uint8_t * buffer , unsigned offset , unsigned len ,
106+ const uint8_t * buffer , unsigned int offset , unsigned int len ,
107107 uint32_t flash_info );
108108
109109/* Can set bits 3:0 in result. */
@@ -113,7 +113,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
113113 * after pprog_cmd
114114 */
115115int flash_fespi (volatile uint32_t * ctrl_base , uint32_t page_size ,
116- const uint8_t * buffer , unsigned offset , uint32_t count ,
116+ const uint8_t * buffer , unsigned int offset , uint32_t count ,
117117 uint32_t flash_info )
118118{
119119 int result ;
@@ -163,12 +163,12 @@ int flash_fespi(volatile uint32_t *ctrl_base, uint32_t page_size,
163163 return result ;
164164}
165165
166- static uint32_t fespi_read_reg (volatile uint32_t * ctrl_base , unsigned address )
166+ static uint32_t fespi_read_reg (volatile uint32_t * ctrl_base , unsigned int address )
167167{
168168 return ctrl_base [address / 4 ];
169169}
170170
171- static void fespi_write_reg (volatile uint32_t * ctrl_base , unsigned address , uint32_t value )
171+ static void fespi_write_reg (volatile uint32_t * ctrl_base , unsigned int address , uint32_t value )
172172{
173173 ctrl_base [address / 4 ] = value ;
174174}
@@ -188,7 +188,7 @@ static void fespi_enable_hw_mode(volatile uint32_t *ctrl_base)
188188/* Can set bits 7:4 in result. */
189189static int fespi_txwm_wait (volatile uint32_t * ctrl_base )
190190{
191- unsigned timeout = TIMEOUT ;
191+ unsigned int timeout = TIMEOUT ;
192192
193193 while (timeout -- ) {
194194 uint32_t ip = fespi_read_reg (ctrl_base , FESPI_REG_IP );
@@ -209,7 +209,7 @@ static void fespi_set_dir(volatile uint32_t *ctrl_base, bool dir)
209209/* Can set bits 11:8 in result. */
210210static int fespi_tx (volatile uint32_t * ctrl_base , uint8_t in )
211211{
212- unsigned timeout = TIMEOUT ;
212+ unsigned int timeout = TIMEOUT ;
213213
214214 while (timeout -- ) {
215215 uint32_t txfifo = fespi_read_reg (ctrl_base , FESPI_REG_TXFIFO );
@@ -224,7 +224,7 @@ static int fespi_tx(volatile uint32_t *ctrl_base, uint8_t in)
224224/* Can set bits 15:12 in result. */
225225static int fespi_rx (volatile uint32_t * ctrl_base , uint8_t * out )
226226{
227- unsigned timeout = TIMEOUT ;
227+ unsigned int timeout = TIMEOUT ;
228228
229229 while (timeout -- ) {
230230 uint32_t value = fespi_read_reg (ctrl_base , FESPI_REG_RXFIFO );
@@ -252,7 +252,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
252252 if (result != ERROR_OK )
253253 return result | ERROR_STACK (0x20000 );
254254
255- unsigned timeout = TIMEOUT ;
255+ unsigned int timeout = TIMEOUT ;
256256 while (timeout -- ) {
257257 result = fespi_tx (ctrl_base , 0 );
258258 if (result != ERROR_OK )
@@ -273,7 +273,7 @@ static int fespi_wip(volatile uint32_t *ctrl_base)
273273
274274/* Can set bits 23:20 in result. */
275275static int fespi_write_buffer (volatile uint32_t * ctrl_base ,
276- const uint8_t * buffer , unsigned offset , unsigned len ,
276+ const uint8_t * buffer , unsigned int offset , unsigned int len ,
277277 uint32_t flash_info )
278278{
279279 int result = fespi_tx (ctrl_base , SPIFLASH_WRITE_ENABLE );
@@ -304,7 +304,7 @@ static int fespi_write_buffer(volatile uint32_t *ctrl_base,
304304 if (result != ERROR_OK )
305305 return result | ERROR_STACK (0x600000 );
306306
307- for (unsigned i = 0 ; i < len ; i ++ ) {
307+ for (unsigned int i = 0 ; i < len ; i ++ ) {
308308 result = fespi_tx (ctrl_base , buffer [i ]);
309309 if (result != ERROR_OK )
310310 return result | ERROR_STACK (0x700000 );
0 commit comments