Commit e0ead84895dc439c42f83fa18ebbe88865e8383b

Authored by Wolfgang Denk
1 parent 6915840ffb

board/rbc823/flash.c: Fix flash initalization

The RBC823 has only one NOR flash bank.  Remove all code trying to
deal with a second bank.  This also fixes a number of GCC 4.6 build
warnings:
flash.c: In function 'flash_init':
flash.c:62:12: warning: array subscript is above array bounds
[-Warray-bounds]
flash.c:63:12: warning: array subscript is above array bounds
[-Warray-bounds]
flash.c:66:12: warning: array subscript is above array bounds
[-Warray-bounds]

Signed-off-by: Wolfgang Denk <wd@denx.de>

Showing 1 changed file with 3 additions and 9 deletions Side-by-side Diff

board/rbc823/flash.c
... ... @@ -35,7 +35,7 @@
35 35  
36 36 unsigned long flash_init(void)
37 37 {
38   - unsigned long size_b0, size_b1;
  38 + unsigned long size_b0;
39 39 int i;
40 40  
41 41 /* Init: no FLASHes known */
42 42  
43 43  
... ... @@ -57,15 +57,9 @@
57 57 &flash_info[0]);
58 58 #endif
59 59  
60   - size_b1 = 0 ;
61   -
62   - flash_info[1].flash_id = FLASH_UNKNOWN;
63   - flash_info[1].sector_count = -1;
64   -
65 60 flash_info[0].size = size_b0;
66   - flash_info[1].size = size_b1;
67 61  
68   - return size_b0 + size_b1;
  62 + return size_b0;
69 63 }
70 64  
71 65 /*-----------------------------------------------------------------------
... ... @@ -181,7 +175,7 @@
181 175  
182 176 /* Write auto select command: read Manufacturer ID */
183 177  
184   - debug("Base address is: %08x\n", caddr);
  178 + debug("Base address is: %8p\n", caddr);
185 179  
186 180 caddr[0x0555] = 0xAA;
187 181 caddr[0x02AA] = 0x55;