...
make config starts to build compiler environment. It may take a few minutes. Please wait for make config completing the processes.
3. Modify device-tree source file
This step is for jffs2 (3) root file-system. Please skip this step if you are using initramfs (4) root file-system.
Modify device-tree node sp_spinor0 in device-tree source file linux/kernel/arch/arm/boot/dts/sp7021-ev.dts to setup operating frequency SPI-NOR flash and pins as shown below:
Code Block |
---|
&sp_spinor0 {
spi-max-frequency = <50000000>;
spi-chip-selection = <0>;
pinctrl-names = "default";
pinctrl-0 = <&spi_flash2_mux &spi_fla4b2_mux>;
} |
where operating frequency of SPI-NOR flash is 50 MHz and SPI-NOR flash is installed in pin-group: spi_flash2_mux and spi_fla4b2_mux. Set them base on your real hardware installation.
4. Remove SECT_4K flag of NOR flash
This step is for jffs2 (3) root file-system. Please skip this step if you are using initramfs (4) root file-system.
Some SPI-NOR flashes support 4 kB sector-erase, but mkfs.jffs2 -e option does not support 4 kB size of erase. Please remove SECT_4K flag in C file “driver/mtd/spi-nor/spi-nor.c” if your NOR flash support 4 KB sector-erase . Refer to screenshot of diff report, SECT_4K flag of Winbond w25q128 flashes are removed.
...
...
5. Build NOR image
Run make all command to start to create all images of SP7021. It may take several minutes to complete. At almost final stage of building processes, make will ask you to select the use of iBoot,
...
The final binary spi_all.bin is built and copied to folder out. Refer to screenshot of output of ll out command:
...
...
6. Write your SPI NOR flash
Put your SPI-NOR flash chip into socket of flash programmer. Be careful about the pin 1 position of the chip. It should be at the same corner of pin 1 of socket. Refer to picture below, an SPI NOR flash is placed at socket of a GZUT USB flash programmer.
...
Remove the SPI NOR flash chip from socket. Note that the size of 'spi_all.bin' is about 14.2 MiB. So, size of SPI NOR flash chip should be 16 MiB (or 128 Mibit) or greater.
...
7. Set DIP-SW to “boot from SPI-NOR flash”
Plug the written SPI-NOR flash into socket of SPI NOR flash of SP7021 board. Set DIP-SW (boot-select switch) to “boot from SPI-NOR flash”. For example, if you are using SP7021 Ev Board, please set DIP-SW to OFF-OFF-ON-OFF-ON-OFF (1-1-0-1-0-1) for booting from SPI-NOR flash. Refer to picture below, DIP-SW is set to OFF-OFF-ON-OFF-ON-OFF.
...