cfi_util.c (c95baf12f5077419db01313ab61c2aac007d40cd) cfi_util.c (025a06c1104cd8995646b761d117816b5f28c873)
1/*
2 * Common Flash Interface support:
3 * Generic utility functions not dependent on command set
4 *
5 * Copyright (C) 2002 Red Hat
6 * Copyright (C) 2003 STMicroelectronics Limited
7 *
8 * This code is covered by the GPL.

--- 95 unchanged lines hidden (view full) ---

104 /* Now replicate it across the size of an unsigned long, or
105 just to the bus width as appropriate */
106 switch (chips_per_word) {
107 default: BUG();
108#if BITS_PER_LONG >= 64
109 case 8:
110 onecmd |= (onecmd << (chip_mode * 32));
111#endif
1/*
2 * Common Flash Interface support:
3 * Generic utility functions not dependent on command set
4 *
5 * Copyright (C) 2002 Red Hat
6 * Copyright (C) 2003 STMicroelectronics Limited
7 *
8 * This code is covered by the GPL.

--- 95 unchanged lines hidden (view full) ---

104 /* Now replicate it across the size of an unsigned long, or
105 just to the bus width as appropriate */
106 switch (chips_per_word) {
107 default: BUG();
108#if BITS_PER_LONG >= 64
109 case 8:
110 onecmd |= (onecmd << (chip_mode * 32));
111#endif
112 /* fall through */
112 fallthrough;
113 case 4:
114 onecmd |= (onecmd << (chip_mode * 16));
113 case 4:
114 onecmd |= (onecmd << (chip_mode * 16));
115 /* fall through */
115 fallthrough;
116 case 2:
117 onecmd |= (onecmd << (chip_mode * 8));
116 case 2:
117 onecmd |= (onecmd << (chip_mode * 8));
118 /* fall through */
118 fallthrough;
119 case 1:
120 ;
121 }
122
123 /* And finally, for the multi-word case, replicate it
124 in all words in the structure */
125 for (i=0; i < words_per_bus; i++) {
126 val.x[i] = onecmd;

--- 33 unchanged lines hidden (view full) ---

160
161 res = onestat;
162 switch(chips_per_word) {
163 default: BUG();
164#if BITS_PER_LONG >= 64
165 case 8:
166 res |= (onestat >> (chip_mode * 32));
167#endif
119 case 1:
120 ;
121 }
122
123 /* And finally, for the multi-word case, replicate it
124 in all words in the structure */
125 for (i=0; i < words_per_bus; i++) {
126 val.x[i] = onecmd;

--- 33 unchanged lines hidden (view full) ---

160
161 res = onestat;
162 switch(chips_per_word) {
163 default: BUG();
164#if BITS_PER_LONG >= 64
165 case 8:
166 res |= (onestat >> (chip_mode * 32));
167#endif
168 /* fall through */
168 fallthrough;
169 case 4:
170 res |= (onestat >> (chip_mode * 16));
169 case 4:
170 res |= (onestat >> (chip_mode * 16));
171 /* fall through */
171 fallthrough;
172 case 2:
173 res |= (onestat >> (chip_mode * 8));
172 case 2:
173 res |= (onestat >> (chip_mode * 8));
174 /* fall through */
174 fallthrough;
175 case 1:
176 ;
177 }
178
179 /* Last, determine what the bit-pattern should be for a single
180 device, according to chip mode and endianness... */
181 switch (chip_mode) {
182 case 1:

--- 263 unchanged lines hidden ---
175 case 1:
176 ;
177 }
178
179 /* Last, determine what the bit-pattern should be for a single
180 device, according to chip mode and endianness... */
181 switch (chip_mode) {
182 case 1:

--- 263 unchanged lines hidden ---