Commit ef26b7d
mtd: spi-nor: add spi_nor_init() function
This patch extracts some chunks from spi_nor_init_params and spi_nor_scan()
and moves them into a new spi_nor_init() function.
Indeed, spi_nor_init() regroups all the required SPI flash commands to be
sent to the SPI flash memory before performing any runtime operations
(Fast Read, Page Program, Sector Erase, ...). Hence spi_nor_init():
1) removes the flash protection if applicable for certain vendors.
2) sets the Quad Enable bit, if needed, before using Quad SPI protocols.
3) makes the memory enter its (stateful) 4-byte address mode, if needed,
for SPI flash memory > 128Mbits not supporting the 4-byte address
instruction set.
spi_nor_scan() now ends by calling spi_nor_init() once the probe phase has
completed. Further patches could also use spi_nor_init() to implement the
mtd->_resume() handler for the spi-nor framework.
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
(cherry picked from commit 46dde01)1 parent a16134b commit ef26b7d
2 files changed
Lines changed: 48 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2630 | 2630 | | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | | - | |
2634 | | - | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
2635 | 2660 | | |
2636 | 2661 | | |
2637 | 2662 | | |
2638 | 2663 | | |
2639 | 2664 | | |
2640 | 2665 | | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
2641 | 2671 | | |
2642 | 2672 | | |
2643 | 2673 | | |
| |||
2708 | 2738 | | |
2709 | 2739 | | |
2710 | 2740 | | |
2711 | | - | |
2712 | | - | |
2713 | | - | |
2714 | | - | |
2715 | | - | |
2716 | | - | |
2717 | | - | |
2718 | | - | |
2719 | | - | |
2720 | | - | |
2721 | | - | |
2722 | | - | |
2723 | | - | |
2724 | | - | |
2725 | 2741 | | |
2726 | 2742 | | |
2727 | 2743 | | |
| |||
2804 | 2820 | | |
2805 | 2821 | | |
2806 | 2822 | | |
2807 | | - | |
2808 | | - | |
2809 | 2823 | | |
2810 | 2824 | | |
2811 | 2825 | | |
| |||
2822 | 2836 | | |
2823 | 2837 | | |
2824 | 2838 | | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
2825 | 2845 | | |
2826 | 2846 | | |
2827 | 2847 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
234 | 240 | | |
235 | 241 | | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| 245 | + | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
| |||
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| 272 | + | |
265 | 273 | | |
266 | 274 | | |
267 | 275 | | |
268 | 276 | | |
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| 280 | + | |
272 | 281 | | |
273 | 282 | | |
274 | 283 | | |
| |||
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
| 308 | + | |
299 | 309 | | |
300 | 310 | | |
301 | 311 | | |
| |||
0 commit comments